Next: SRFI-19 String to date, Previous: SRFI-19 Time/Date conversions, Up: SRFI-19
Convert a date to a string under the control of a format. format should be a string containing `~' escapes, which will be expanded as per the following conversion table. The default format is `~c', a locale-dependent date and time.
Many of these conversion characters are the same as POSIX
strftime(see Time), but there are some extras and some variations.
~~literal ~ ~alocale abbreviated weekday, eg. `Sun' ~Alocale full weekday, eg. `Sunday' ~blocale abbreviated month, eg. `Jan' ~Blocale full month, eg. `January' ~clocale date and time, eg.
`Fri Jul 14 20:28:42-0400 2000'~dday of month, zero padded, `01' to `31'
~eday of month, blank padded, ` 1' to `31' ~fseconds and fractional seconds, with locale decimal point, eg. `5.2' ~hsame as ~b~Hhour, 24-hour clock, zero padded, `00' to `23' ~Ihour, 12-hour clock, zero padded, `01' to `12' ~jday of year, zero padded, `001' to `366' ~khour, 24-hour clock, blank padded, ` 0' to `23' ~lhour, 12-hour clock, blank padded, ` 1' to `12' ~mmonth, zero padded, `01' to `12' ~Mminute, zero padded, `00' to `59' ~nnewline ~Nnanosecond, zero padded, `000000000' to `999999999' ~plocale AM or PM ~rtime, 12 hour clock, `~I:~M:~S ~p' ~snumber of full seconds since “the epoch” in UTC ~Ssecond, zero padded `00' to `60'
(usual limit is 59, 60 is a leap second)~thorizontal tab character ~Ttime, 24 hour clock, `~H:~M:~S' ~Uweek of year, Sunday first day of week, `00' to `52' ~Vweek of year, Monday first day of week, `01' to `53' ~wday of week, 0 for Sunday, `0' to `6' ~Wweek of year, Monday first day of week, `00' to `52'
~yyear, two digits, `00' to `99' ~Yyear, full, eg. `2003' ~ztime zone, RFC-822 style ~Ztime zone symbol (not currently implemented) ~1ISO-8601 date, `~Y-~m-~d' ~2ISO-8601 time+zone, `~k:~M:~S~z' ~3ISO-8601 time, `~k:~M:~S' ~4ISO-8601 date/time+zone, `~Y-~m-~dT~k:~M:~S~z' ~5ISO-8601 date/time, `~Y-~m-~dT~k:~M:~S'
Conversions `~D', `~x' and `~X' are not currently described here, since the specification and reference implementation differ.
Currently Guile doesn't implement any localizations for the above, all
outputs are in English, and the `~c' conversion is POSIX
ctime style `~a ~b ~d ~H:~M:~S~z ~Y'. This may change in
the future.