[Discuss] Interesting linux date bug

John Blomfield jabfield at shaw.ca
Mon Mar 3 16:39:49 PST 2008


Alan W. Irwin wrote:
> On 2008-03-03 11:34-0800 pw wrote:
>
>> Apparently this second didn't exist:
>>
>> date -u -d "12/31/1969 23:59:59" +%s
>
> What distro are you using? That command works fine on my (64-bit) Debian
> testing system:
>
> irwin at raven> date -u -d "12/31/1969 23:59:59" +%s
> -1
>  
Fedora 8 agrees, works fine too.

John

>
> Also, the epoch for one second later also works....
>
> irwin at raven> date -u -d "01/01/1970 00:00:00" +%s
> 0
>
> Just to throw a curve ball into the discussion, watch out for leap 
> seconds,
> see http://en.wikipedia.org/wiki/Unix_time.  The above epochs did not 
> have
> leap seconds, but apparently there are Unix computer-time 
> inconsistencies at
> epochs where leap seconds (necessary to account for the varying rotation
> rate of the earth) occur.
>
> Alan
> __________________________
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and 
> Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
>
> Programming affiliations with the FreeEOS equation-of-state 
> implementation
> for stellar interiors (freeeos.sf.net); PLplot scientific plotting 
> software
> package (plplot.org); the libLASi project (unifont.org/lasi); the 
> Loads of
> Linux Links project (loll.sf.net); and the Linux Brochure Project
> (lbproject.sf.net).
> __________________________
>
> Linux-powered Science
> __________________________
> _______________________________________________
> Discuss mailing list
> Discuss at vlug.org
> http://ladybug.vlug.org/cgi-bin/mailman/listinfo/discuss
>



More information about the Discuss mailing list