Re: c-common.c; strftime.c; question
From guy@netapp.com Thu Aug 22 19:45:31 1996
If you are going to follow the standards, then strftime() should replace %x with the "locale's appropriate date representation". That means that the date representation should vary based on the locale that the caller is running under. The default locale is the C locale.
I am at home and I do not keep the standards here, so I cannot look up what that should be, but I can do it later tonight or tomorrow.
My copy of ANSI X3.159-1989 doesn't appear to specify the C locale's "appropriate date representation". My copy of IEEE 1003.1b-1993 doesn't appear to specify it either.
There must be something wrong with my real job that I am spending so much time on this :-) I found the XPG4 definition of the C/POSIX locale (for those reading along, I am in the XPG4 System Interfaces Definitions Issue 4, Version 2). The LC_TIME locale category is discussed starting at Section 5.3.5, p. 69. The C/POSIX locale value for d_fmt (the thing associated with %x) is "%m/%d/%y". This can be found on p. 75. Normally, XPG4 is not very creative here, so I doubt they made this up, but I cannot find where they could have taken it from. I will ask the big league standards guys around here tomorrow. alan
Date: Thu, 22 Aug 1996 20:39:31 -0700 From: Alan.Perry@Eng.Sun.COM (Alan Perry) The C/POSIX locale value for d_fmt (the thing associated with %x) is "%m/%d/%y". This can be found on p. 75. Most likely this was taken from Posix.2 Table 2-11 (page 64), which requires that %x be "%m/%d/%y" in the Posix locale. The same table also requires that %c must be "%a %b %e %H:%M:%S %Y" in the Posix locale, so tz's strftime.c should probably be changed accordingly (currently it's "%D %X"). Not that many programs actually _use_ %c or %x....
participants (2)
-
Alan.Perry@Eng.Sun.COM -
Paul Eggert