On 2022-09-15 11:45, Jon Turney wrote:
On 14/09/2022 03:52, Brian Inglis wrote:
[Please Reply All due to email issues]
newlib/libc/time/strftime.c(strftime): add %i, %q, %v, tests; tweak %Z
docs
newlib/libc/time/strptime.c(strptime_l): add %i, %q, %v
winsup/cygwin/libc/strptime.cc(__strptime): add %i, %q, %v
%i year in century [00..99] Synonym for "%y". Non-POSIX extension.
[tm_year]
%q GNU quarter of the year (from `<<1>>' to `<<4>>') [tm_mon]
%v OSX/Ruby VMS/Oracle date "%d-%b-%Y". Non-POSIX extension. [tm_mday,
tm_mon, tm_year]
add %i %q %v tests
%Z clarify current time zone *abbreviation* not "name" [tm_isdst]
The newlib patches should go to the newlib list.
Right - okay - should have remembered - will split and add xrefs.
Do you have a reference for an OS supporting the %i extension? I'm just
curious if it specifies the same pivot year for strptime() as POSIX does
for %y?
It was documented as a synonym for %y, so %i uses the code for %y.
Sources supporting POSIX pivot at <= 68 => 2000, >= 69 => 1900.
Sorry, I couldn't find the sources for "%i year" when I went looking
back thru my str[fp]time sources searches for comments - too many repos
visited, no case sensitive search engines or page find strings, and
everything supports %I US 12 hour clock and various year formats!
It may have been a newer language library implementation.
I don't keep copies of sources or links to avoid possibilities of
plagiarism or influence, making it easier to follow existing approaches
in the source files being changed.
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]
[For Y2K, two digit year formats were deprecated and upgraded, so I'm
extremely disappointed, nay disgusted, that they still haven't been
dropped, as they will continue to be ambiguous until 2031, as I flip
between English language sites in various countries!
I'm in favour of promoting -Werror=format-y2k, similar to the common
-Werror=format-security build option!
But given that few care to remember the issues, costs, solutions, and
recommendations, I'll support adding the convenience format.]