View Source API Reference DateTimeParser v1.2.0
Modules
The biggest ambiguity between datetime formats is whether it's ymd
(year month
day), mdy
(month day year), or dmy
(day month year); this is resolved by
checking if there are slashes or dashes. If slashes, then it will try dmy
first. All other cases will use the international format ymd
. Sometimes, if
the conditions are right, it can even parse dmy
with dashes if the month is a
vocal month (eg, "Jan"
).
An error when parsing fails
Interface for the DateTimeParser to use when parsing a string.
Tokenizes the string for date formats. This prioritizes the international standard for representing dates.
Tokenizes the string for both date and time formats. This prioritizes the international standard for representing dates.
Tokenizes the string for both date and time formats. This prioritizes the US format for representing dates.
Tokenizes the string for date formats. This prioritizes the US format for representing dates.
Parses a Unix Epoch timestamp. This is gated by the number of present digits. It must contain 10 or 11 seconds, with an optional subsecond up to 10 digits. Negative epoch timestamps are supported.
Parses a spreadsheet Serial timestamp. This is gated by the number of present digits. It must contain 1 through 5 digits that represent days, with an optional precision of up to 10 digits that represents time. Negative serial timestamps are supported.
Tokenizes the string for time elements. This will also attempt to extract the time out of the string first before tokenizing to reduce noise in an attempt to be more accurate. For example,
This parser doesn't parse, instead it checks the string and assigns the appropriate parser during
preflight. The appropriate parser is determined by whether there is a "/"
present in the string,
and if so it will assume the string is a US-formatted date or datetime, and therefore use the
US-optimized tokenizer module (ie, DateTimeParser.Parser.DateUS
or
DateTimeParser.Parser.DateTimeUS
) for them. Time will always be parsed with
DateTimeParser.Parser.Time
.
Fetch timezone information by name or by abbreviations. This is designed to power parsing strings with timezone abbreviations and offsets in them.