Skip to content

Specifiers

imshooter edited this page Nov 26, 2026 · 2 revisions

Times

Each example is Saturday, June 2nd 2018 at 08:47:12, in a zone an hour ahead of UTC.

Specifier Define Writes
%a WEEKDAY_NAME_ABV The name of the day, short: Sat.
%A WEEKDAY_NAME The name of the day: Saturday.
%b, %h MONTH_NAME_ABV The name of the month, short: Jun.
%B MONTH_NAME The name of the month: June.
%c The date and time: Sat Jun 2 08:47:12 2018.
%C YEAR_DIV The year divided by 100: 20.
%d DAY_OF_MONTH The day of the month: 02.
%D DATE_MDY %m/%d/%y: 06/02/18.
%e DAY_OF_MONTH_PAD The day of the month, a space before one digit: 2.
%F DATE_YMD %Y-%m-%d: 2018-06-02.
%g WEEK_NUMBER_ISO The last two digits of the year of the ISO week: 18.
%G YEAR_PAD The year of the ISO week: 2018.
%H HOUR_24 The hour of a 24 hour clock: 08.
%I HOUR_12 The hour of a 12 hour clock: 08.
%j DAY_OF_YEAR The day of the year: 153.
%m MONTH The month: 06.
%M MINUTE The minute: 47.
%n NEWLINE_CHAR A new line.
%p MERIDIAN AM or PM.
%r TIME_12 The time of a 12 hour clock: 08:47:12 AM.
%R HM_COLON %H:%M: 08:47.
%S SECOND The second: 12.
%t TAB_CHAR A tab.
%T HMS_COLON %H:%M:%S: 08:47:12.
%u WEEK_DAY The day of the week, from 1 on Monday: 6.
%U WEEK_OF_YEAR The week of the year, weeks from Sunday: 21.
%V WEEK_OF_YEAR_ZERO The ISO week of the year: 22.
%w WEEK_DAY_ZERO The day of the week, from 0 on Sunday: 6.
%W WEEK_OF_YEAR_ALT The week of the year, weeks from Monday: 22.
%x LOCALE_DATE %m/%d/%y: 06/02/18.
%X LOCALE_TIME %H:%M:%S: 08:47:12.
%y YEAR_ABV The last two digits of the year: 18.
%Y YEAR The year: 2018.
%z UTC_OFFSET The offset from UTC: +0100. %Ez writes +01:00.
%Z TIME_ZONE_ABV The abbreviation of the zone, as the zones of the machine name it.
%% PERCENTAGE A %.

E and O before a specifier are taken and left out, but for %Ez and %Oz.

Formats

Define Format Writes
HUMAN_DATE %d/%m/%y 02/06/18
ISO8601_DATE %Y-%m-%d 2018-06-02
ISO8601_TIME %H:%M:%S 08:47:12
ISO8601_FULL_LOCAL %Y-%m-%dT%H:%M:%S 2018-06-02T08:47:12
ISO8601_FULL_UTC %Y-%m-%dT%H:%M:%SZ 2018-06-02T07:47:12Z, written with the zone "UTC"

The ISO6801_* names of pawn-chrono stay beside them.

Reading

TimeParse reads every specifier above. Names are read whole or by their first three letters, in any case, %Z is read and left out, %I needs %p, and a width before a specifier, as %4Y, is the most digits it takes. The date comes from the month and day, the day of the year with %j, the ISO week with %G, %V and %u, or a week with %U or %W and a weekday, in that order.

Durations

DurationFormat takes these, each holding what the larger ones in the format leave:

Specifier Writes
%y, %Y Years of 365 days.
%d, %D Days.
%h, %H Hours.
%m, %M Minutes.
%s, %S Seconds.
%% A %.

In capitals they are written in two digits. DURATION_CLOCK is %H:%M:%S.

Clone this wiki locally