Timex.DateFormat.Formats

This module defines all known (by timex) common date/time formats, in macro form.

Each format is returned as the following structure:

[tokenizer: , format: ]

These formats are consumed by the datetime string parsers, by first tokenizing the chosen format, then parsing the datetime string using those tokens.

Summary

ansic()

ANSI C standard date/time format. Example: Tue Mar 5 23:25:19 2013

iso_8601()

ISO 8601 date/time format with timezone information. Example: 2007-08-13T16:48:01 +0300

iso_8601z()

ISO 8601 date/time format, assumes UTC/Zulu timezone. Example: 2007-08-13T13:48:01Z

iso_date()

ISO-standardized year/month/day format. Example: 2013-02-29

iso_ordinal()

ISO year, followed by ISO ordinal day Example: 2007-113

iso_time()

ISO-standardized hour/minute/second format. Example: 23:05:45

iso_week()

ISO year, followed by ISO week number Example: 2007-W09

iso_weekday()

ISO year, followed by ISO week number, and ISO week day number Example: 2007-W09-1

kitchen()

Kitchen clock time format. Example: 3:25PM

rfc_1123()

RFC 1123 date/time format with timezone information. Example: Tue, 05 Mar 2013 23:25:19 GMT

rfc_1123z()

RFC 1123 date/time format, assumes UTC/Zulu timezone. Example: Tue, 05 Mar 2013 23:25:19 +0200

rfc_3339()

RFC 3339 date/time format with timezone information. Example: 2013-03-05T23:25:19+02:00

rfc_3339z()

RFC 3339 date/time format, assumes UTC/Zulu timezone. Example: 2013-03-05T23:25:19Z

rfc_822()

RFC 822 date/time format with timezone information. Examples: Mon, 05 Jun 14 23:20:59 Y

rfc_822z()

Same as rfc_822, but locked to universal time

slashed_date()

Month, day, and year, in slashed style. Example: 04/12/1987

strftime_clock()

Wall clock in strftime format. Example: 23:30

strftime_iso_date()

ISO date, in strftime format. Example: 1987-04-12

strftime_kitchen()

Kitchen clock in strftime format. Example: 4:30:01 PM

strftime_shortdate()

Friendly short date format. Uses spaces for padding on the day. Example: 5-Jan-2014

unix()

UNIX standard date/time format. Example: Tue Mar 5 23:25:19 PST 2013

Macros

ansic()

ANSI C standard date/time format. Example: Tue Mar 5 23:25:19 2013

iso_8601()

ISO 8601 date/time format with timezone information. Example: 2007-08-13T16:48:01 +0300

iso_8601z()

ISO 8601 date/time format, assumes UTC/Zulu timezone. Example: 2007-08-13T13:48:01Z

iso_date()

ISO-standardized year/month/day format. Example: 2013-02-29

iso_ordinal()

ISO year, followed by ISO ordinal day Example: 2007-113

iso_time()

ISO-standardized hour/minute/second format. Example: 23:05:45

iso_week()

ISO year, followed by ISO week number Example: 2007-W09

iso_weekday()

ISO year, followed by ISO week number, and ISO week day number Example: 2007-W09-1

kitchen()

Kitchen clock time format. Example: 3:25PM

rfc_1123()

RFC 1123 date/time format with timezone information. Example: Tue, 05 Mar 2013 23:25:19 GMT

rfc_1123z()

RFC 1123 date/time format, assumes UTC/Zulu timezone. Example: Tue, 05 Mar 2013 23:25:19 +0200

rfc_3339()

RFC 3339 date/time format with timezone information. Example: 2013-03-05T23:25:19+02:00

rfc_3339z()

RFC 3339 date/time format, assumes UTC/Zulu timezone. Example: 2013-03-05T23:25:19Z

rfc_822()

RFC 822 date/time format with timezone information. Examples: Mon, 05 Jun 14 23:20:59 Y

From the specification (RE: timezones):

Time zone may be indicated in several ways. “UT” is Univer- sal Time (formerly called “Greenwich Mean Time”); “GMT” is per- mitted as a reference to Universal Time. The military standard uses a single character for each zone. “Z” is Universal Time. “A” indicates one hour earlier, and “M” indicates 12 hours ear- lier; “N” is one hour later, and “Y” is 12 hours later. The letter “J” is not used. The other remaining two forms are taken from ANSI standard X3.51-1975. One allows explicit indication of the amount of offset from UT; the other uses common 3-character strings for indicating time zones in North America.

rfc_822z()

Same as rfc_822, but locked to universal time.

slashed_date()

Month, day, and year, in slashed style. Example: 04/12/1987

strftime_clock()

Wall clock in strftime format. Example: 23:30

strftime_iso_date()

ISO date, in strftime format. Example: 1987-04-12

strftime_kitchen()

Kitchen clock in strftime format. Example: 4:30:01 PM

strftime_shortdate()

Friendly short date format. Uses spaces for padding on the day. Example: 5-Jan-2014

unix()

UNIX standard date/time format. Example: Tue Mar 5 23:25:19 PST 2013