-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Timezone claims to format dates "with a full implementation of strftime formats, including the GNU date extensions." The stftime man page describes %F as "equivalent to %Y-%m-%d (the ISO 8601 date format)." There is, however, ambiguity here when dealing with years prior to 1000. The man page also describes %Y as "the year as a decimal number including the century." But ISO 8601 "prescribes, as a minimum, a four-digit year [YYYY]."
I am ambivalent about whether %Y should be changed to always include four digits. Some languages (e.g. ruby) treat %Y as a CCYY value even for single digit centuries, others as variable width; in python, a century less than 1000 is raised as an error. I believe it is appropriate to see "May 1, 900" as the output for the format string %b %-e, %Y on a date of 0900-05-01, but would already see "May 1, 0900" from ruby anyways.
However, I believe if %Y remains variable width, %F's ambiguity should be resolved in the direction of conforming to ISO 8601 rather than conforming to equivalence with %Y-%m-%d. %F is primarily used as a machine-oriented format string (particularly when generating ISO 8601 strings). Without an ISO 8601 compliant %F, there is no format string that can be provided to produce an ISO 8601 output.