strftime ( format-string -- quot )
Formatted printing

Prev:sprintf ( format-string -- quot )


Vocabulary
formatting

Inputs
format-stringa string


Outputs
None

Word description
Writes the timestamp (specified on the stack) formatted according to the format string.

Different attributes of the timestamp can be retrieved using format specifications.

%aAbbreviated weekday name.
%AFull weekday name.
%bAbbreviated month name.
%BFull month name.
%cDate and time representation.
%dDay of the month as a decimal number [01,31].
%HHour (24-hour clock) as a decimal number [00,23].
%IHour (12-hour clock) as a decimal number [01,12].
%jDay of the year as a decimal number [001,366].
%mMonth as a decimal number [01,12].
%MMinute as a decimal number [00,59].
%pEither AM or PM.
%SSecond as a decimal number [00,59].
%UWeek number of the year (Sunday as the first day of the week) as a decimal number [00,53].
%wWeekday as a decimal number [0(Sunday),6].
%WWeek number of the year (Monday as the first day of the week) as a decimal number [00,53].
%xDate representation.
%XTime representation.
%yYear without century as a decimal number [00,99].
%YYear with century as a decimal number.
%ZTime zone name (no characters if no time zone exists).
%%A literal '%' character.


Examples
USING: calendar formatting io ; now "%c" strftime print
Mon Dec 15 14:40:43 2008


Definition