bug-coreutils
[Top][All Lists]
Advanced

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

Re: date bug


From: Eric Blake
Subject: Re: date bug
Date: Tue, 22 Aug 2006 08:27:01 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Thunderbird/1.5.0.5 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to David Cermak on 8/22/2006 7:16 AM:
> Hello,
> as i really can't believe that it looks like a bug:
> 
> address@hidden:~$ date -d "01/01/1830" +"%s"
> date: invalid date `01/01/1830'

This is due to limitations on platforms where time is tracked as a 32-bit
number of seconds since 1970; 1830 is just too far away (just as dates
beyond 2038 are too far in the other direction).  It is not really a bug.

> 
> that's ok, but >
> 
> address@hidden:~$ date -d "01/01/1902" +"%s"
> -2145920400
> address@hidden:~$ date -d "01/01/1901" +"%s"
> -2147483648
> address@hidden:~$ date -d "01/01/1900" +"%s"
> -2147483648
> 
> address@hidden:~$ date -d "01/01/1900"
> Fri Dec 13 21:45:52 CET 1901
> address@hidden:~$ date -d "01/01/1902"
> Wed Jan  1 00:00:00 CET 1902
> address@hidden:~$ date -d "01/01/1901"
> Fri Dec 13 21:45:52 CET 1901

What version are you using?  It seems like you need to upgrade.  With
5.97, I get:

$ date -d "01/01/1900"
date: invalid date `01/01/1900'
$ date -d "01/01/1901"
date: invalid date `01/01/1901'
$ date -d "01/01/1902"
Wed Jan  1 00:00:00 MST 1902
$ date -d "01/01/1900" +%s
date: invalid date `01/01/1900'
$ date -d "01/01/1901" +%s
date: invalid date `01/01/1901'
$ date -d "01/01/1902" +%s
- -2145891600

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE6xQ184KuGfSFAYARAvSjAKCg5nDXBhPDr1qoy82InKVklBrjlQCfWG2Q
i5/dA96uy/4VslI7F8HKKyQ=
=k6L9
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]