gmtime() oddities for large values

walter harms wharms at bfs.de
Thu May 13 08:37:59 UTC 2010


I have tested on OpenSuSE 11.1. it seems the bug is fixed here.

* Linux 2.6.27.42-0.1-default #1 SMP 2010-01-06 16:07:25 +0100 x86_64 x86_64 x86_64 GNU/Linux
* gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux)
* GNU C Library stable release version 2.9 (20081117), by Roland McGrath et al.

t: 67767976233532798, tp: 0x7fc6fc4e3de0 errno: 0
sec: 58, min: 59, hour: 23, mday: 31, mon: 11, year: 2147481747, wday: 2, yday: 364, isdst: 0, gmtoff: 0, zone: GMT
t: 67767976233532799, tp: 0x7fc6fc4e3de0 errno: 0
sec: 59, min: 59, hour: 23, mday: 31, mon: 11, year: 2147481747, wday: 2, yday: 364, isdst: 0, gmtoff: 0, zone: GMT
t: 67767976233532800, tp: 0x7fc6fc4e3de0 errno: 0
sec: 0, min: 0, hour: 0, mday: 1, mon: 0, year: 2147481748, wday: 3, yday: 0, isdst: 0, gmtoff: 0, zone: GMT
t: 67767976233532801, tp: 0x7fc6fc4e3de0 errno: 0
sec: 1, min: 0, hour: 0, mday: 1, mon: 0, year: 2147481748, wday: 3, yday: 0, isdst: 0, gmtoff: 0, zone: GMT

re,
 wh



> The output on a 64 bit machine is (the interesting part is the sec=59)
> 
> t: 67767976233532798, tp: 0x80085b9a0 errno: 2
> sec: 58, min: 59, hour: 23, mday: 31, mon: 11, year: 2147481747, wday: 2, yday:
> 364, isdst: 0, gmtoff: 0, zone: UTC
> t: 67767976233532799, tp: 0x80085b9a0 errno: 0
> sec: 59, min: 59, hour: 23, mday: 31, mon: 11, year: 2147481747, wday: 2, yday:
> 364, isdst: 0, gmtoff: 0, zone: UTC
> t: 67767976233532800, tp: 0x80085b9a0 errno: 0
> sec: 59, min: 59, hour: 23, mday: 31, mon: 11, year: 2147481747, wday: 2, yday:
> 364, isdst: 0, gmtoff: 0, zone: UTC
> t: 67767976233532801, tp: 0x80085b9a0 errno: 0
> sec: 59, min: 59, hour: 23, mday: 31, mon: 11, year: 2147481747, wday: 2, yday:
> 364, isdst: 0, gmtoff: 0, zone: UTC
> 
> 
> Right now, I am looking for confirmation from people on the list if this
> behaviour is also happening on other 64 bit operating systems or that it is a
> FreeBSD specific quirk.
> 
> Edwin
> 
> 
> 
> 



More information about the tz mailing list