[illumos-Developer] strftime breakage for %c and %C

Garrett D'Amore garrett at damore.org
Mon May 2 11:57:17 PDT 2011


In testing date, I noticed that strftime is possibly busted.  (Depending
on your view of what constitutes breakage.)  Specifically, the behavior
today in illumos is as for POSIX, and the legacy SunOS behavior for some
format specifiers is not preserved:

	%c - the expansion for legacy is %a %b %d %H:%M:%S %Y but for illumos
and POSIX (XPG4) is %a %b %e %H:%M:%S %Y

	%C - for POSIX this is the century number (20 usually), but for legacy
its the "date" format, e.g. Monday, May  2, 2011 11:38:52 AM PDT.  Right
now only the POSIX behavior is accessible via illumos.

I can fix both of these fairly straight-forwardly -- I was the one that
busted them I think -- but I'd like a consensus before I do this.  We
can just accept the POSIX behavior as the only correct behavior for
illumos at this point, or we can preserve the legacy Solaris behavior.

Note that except for the POSIX interpretation of %C, the other formats
are all available via explicit expansion.

Any one have any strong arguments for keeping the POSIX behavior as the
only behavior, or for keeping the SunOS behavior?  (Note that it doesn't
seem to have busted anything .. this has been the case for illumos
pretty much since its inception as I think I busted this in the original
i18n rewrite.)

	- Garrett





More information about the Developer mailing list