Message125343
> The system libc would raise an error (return NULL) if it doesn't know
> how to format years older than 1900.
As experience with asctime has shown, system libc can do whatever it pleases with out of range values including overrunning a fixed size buffer, returning non-sensical values etc. However, now that we have control over asctime implemetation (see issue 8013), I don't see any problem in supporting at least year > 999 in time.asctime and time.ctime. (Supporting full [1900-maxint, maxint] range would involve a decision on whether to fill < 4-digit values.) Some extra care would be required for time.strftime() because some systems may not support year < 1900 as well as others.
It looks like POSIX does not make any strong mandates:
"tm_year is a signed value; therefore, years before 1900 may be represented."
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html
and regardless of what POSIX or C standards have to say, this is the area where systems a known to have spotty compliance records. |
|
Date |
User |
Action |
Args |
2011-01-04 17:30:13 | belopolsky | set | recipients:
+ belopolsky, vstinner, SilentGhost |
2011-01-04 17:30:13 | belopolsky | set | messageid: <1294162213.49.0.928737927372.issue10827@psf.upfronthosting.co.za> |
2011-01-04 17:30:03 | belopolsky | link | issue10827 messages |
2011-01-04 17:30:02 | belopolsky | create | |
|