Tuesday, October 27, 2015

Unicode Date Formats, YYYY?!

Peter Hosey (comments):

YYYY and yyyy are Unicode date format patterns. These offer quite a bit more flexibility than the old str[fp]time(3) formats, particularly in choosing different representations of the same value (e.g., “September” vs “Sep” vs “09” vs “9”).

  • YYYY is defined as the “year for week-of-year”: that is, the year for ISO week dates.
  • yyyy is defined as the calendar year.

You probably want the latter.

Update (2018-12-27): See also: Dave DeLong and Erica Sadun.

Comments RSS · Twitter

Leave a Comment