A parser for european date formats, such as dd.mm.yyyy.
Valid formats:
Format | Example | Description | Method |
---|---|---|---|
dd.mm.yyyy | 23.07.2010 | Date | chrono.parser.EuroParser.date() |
dd-mm-yyyy | 23-07-2010 | Dash-separated date | chrono.parser.EuroParser.dashdate() |
dd/mm/yyyy | 23/07/2010 | Slash-separated date | chrono.parser.EuroParser.slashdate() |
ddmmyyyy | 23072010 | Compact date | chrono.parser.EuroParser.compactdate() |
hh:mm:ss | 15:27:43 | Time | chrono.parser.EuroParser.time() |
hhmmss | 152743 | Compact time | chrono.parser.EuroParser.compacttime() |
Datetime formats can consist of any combination of the date and time formats above, separated by space.
Leading zeroes may be omitted in days and months, and years may be specified with 2 digits, which will be interpreted in the range 1930-2029.
Seconds and minutes may be omitted in times, which will be interpreted as 0.
Parses a compact european date (ddmmyyyy), and returns a tuple with year, month, and day.
Raises chrono.error.ParseError for invalid input format, TypeError for invalid input type, and chrono.error.YearError, chrono.error.MonthError, or chrono.error.DayError for invalid date values.
Parses a compact european time (hhmmss), and returns a tuple with hour, minute, and second.
Raises chrono.error.ParseError for invalid input format, TypeError for invalid input type, and chrono.error.HourError, chrono.error.MinuteError, or chrono.error.SecondError for invalid time values.
Parses a dash-separated european date (dd-mm-yyyy), and returns a tuple with year, month, and day.
Raises chrono.error.ParseError for invalid input format, TypeError for invalid input type, and chrono.error.YearError, chrono.error.MonthError, or chrono.error.DayError for invalid date values.
Parses a european date (dd.mm.yyyy), and returns a tuple with year, month, and day.
Raises chrono.error.ParseError for invalid input format, TypeError for invalid input type, and chrono.error.YearError, chrono.error.MonthError, or chrono.error.DayError for invalid date values.
Parses a european date in any supported format, and returns a tuple with year, month, and day.
Raises chrono.error.ParseError for invalid input format, TypeError for invalid input type, and an appropriate chrono.error.DateError subclass for invalid date values.
Parses a european datetime in any supported format and returns a tuple with year, month, day, hour, minute, and second.
Raises chrono.error.ParseError for invalid input format, TypeError for invalid input type, and an appropriate chrono.error.DateTimeError subclass for invalid datetime values.
Parses a european time in any supported format and returns a tuple with hour, minutes, and seconds.
Raises chrono.error.ParseError for invalid input format, TypeError for invalid input type, and an appropriate chrono.error.TimeError subclass for invalid time values.
Parses a slash-separated european date (mm/dd/yyyy), and returns a tuple with year, month, and day.
Raises chrono.error.ParseError for invalid input format, TypeError for invalid input type, and chrono.error.YearError, chrono.error.MonthError, or chrono.error.DayError for invalid date values.
Parses a european time (hh:mm:ss), and returns a tuple with hour, minute, and second.
Raises chrono.error.ParseError for invalid input format, TypeError for invalid input type, and chrono.error.HourError, chrono.error.MinuteError, or chrono.error.SecondError for invalid time values.