SRFI 19: Time Data Types and Procedures
This is a Chibi Scheme port of
the Standard Implementation
of SRFI 19.
The bulk of the code is from the standard implementation, with only a few tweaks to
make it work under Chibi Scheme. The test suite has been expanded so that each exported
function is exercised at least once.
The full source of this version is available
on GitHub.
Many thanks to Will Fitzgerald and the SRFI Editors for providing the SRFI and the standard
implementation code.
Extensions to SRFI 19
This implementation has two new format directives that I'd really rather were better supported
everywhere.
-
~g - day of month. It just outputs the day of the month (1...31). The other two
standard directives both specify either blank padding or zero padding but there's no option
for no padding.
-
~u - day ordinal suffix. Outputs the locale-specific suffix for the day of the
month. For example "rd" for 3, "th" for 6, or "st" for 21. This allows you to format dates
as "Sunday, 1st of January 2017". It's possible to insert the "st" in such a format string
manually but that doesn't seem a clean approach.