Format and parse datetime strings.
Primarily this module exposes two functions: parser, formatter. These functions provide access to datetime formats defined by a standard or deemed common enough to merit a builtin implementation.
| NOTE | |
Currently does not provide access to strptime and strftime functionality. |
While formatting PiTs can usually occur without error, parsing them from strings can result in a variety of errors. The parsers available in libformat can raise subclasses of core.FormatError.
operator
functools0
fractions0
math0
core0
gregorian0
week0
rfc11230
rfc1123 = "{day_of_week}, {day:02} {month} {year} {hour:02}:{minute:02}:{second:02}"
iso86010
iso8601 = "{0}-{1:02}-{2:02}T{3:02}:{4:02}:{5:02}.{6}"
iso8601_date0
iso8601_date = "{0}-{1:02}-{2:02}"
models0
models = {
'rfc1123' : rfc1123,
'iso8601' : iso8601,
}
split_clock_time0
split_clock_time(s)
parse_rfc1123284%
parse_rfc1123(s)
parse_iso8601196%
parse_iso8601(s)
parsers0
parsers = {
'rfc1123': parse_rfc1123,
'iso8601': parse_iso8601,
}
transform_iso86010
transform_iso8601(args)
transform_rfc11230
transform_rfc1123(args)
transformers0
transformers = {
'iso8601' : transform_iso8601,
'rfc1123' : transform_rfc1123,
}
validate_rfc1123187%
validate_rfc1123(args)
validators0
validators = {
'rfc1123': validate_rfc1123,
}
aliases0
aliases = {'http' : 'rfc1123'}
_parse188%
_parse(fun, format)
_structure188%
_structure(fun, format)
_integrity188%
_integrity(fun, format)
parser0
parser(fmt)
Given a format idenifier, return the function that can be used to parse the formatted string into a Point instance.
format_rfc112320%
format_rfc1123(pitt, subsec, dow)
format_iso86010
format_iso8601(pitt, subsec, dow)
format_iso8601_date0
format_iso8601_date(pitt, subsec, dow)
formatters0
formatters = {
'rfc1123' : format_rfc1123,
'iso8601' : format_iso8601,
}
formatter0
formatter(fmt)
Given a format idenifier, return the function that can be used to format the Point in time.
formats0
formats = {
'iso' : 'iso8601',
'rfc' : 'rfc1123',
}
context0
context(context)