lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Jan 8, 2007, at 8:53 AM, Luiz Henrique de Figueiredo wrote:


On the other hand, this program

for y=1960,1980 do
print(y,os.time{year=y,month=1,day=1})
end

cannot handle years before 1970 (see below). So it seems a limitation
of localtime (which is what os.date uses) not of mktime (which is what
os.time uses). [I wonder why mktime does not give an error past 1902.]


Output on Mac OSX (US Eastern Standard time zone)
1960    -315558000
1961    -283935600
1962    -252399600
1963    -220863600
1964    -189327600
1965    -157705200
1966    -126169200
1967    -94633200
1968    -63097200
1969    -31474800
1970    61200
1971    31597200
1972    63133200
1973    94755600
1974    126291600
1975    157827600
1976    189363600
1977    220986000
1978    252522000
1979    284058000
1980    315594000


Seems like glibc has some problems.



--
Gé Weijers