The specification for strptime
:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html
is mostly clear on the possible conversion specifications and what input they require. However, there seems to be no specification for how this function stores the results in the struct tm
. What is supposed to happen if multiple specifiers read partly or wholly conflicting data. A simple example would be the presence of both %m
and %b
(or even duplicate %m
's) reading conflicting months, but perhaps a more interesting example is when %d
(day of month) and %a
(day of week) conflict. Which takes precedence? Is strptime
even supposed to ensure a consistent output in the struct tm
, or simply store the fields as-read? Certain things like %W
(week of year) have no direct representation in struct tm
, so I would assume they must result in the generation of derived output based on other fields, but it's unclear when this applies.
I realize since the specification seems to be lacking, I may be asking for an answer that simply doesn't exist, but things that could characterize a helpful answer would be:
- behavior of historical implementations on which the standardized function was based.
- citations of relevant defect reports
- links to past discussions of the topic (mailing lists, bug trackers, usenet, etc.)
- other related standards for time parsing