NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
date(1) doesn't handle leap-seconds?
According to the leapseconds file, there was a leap-second added at the
end of 2005, and the second following 2005-12-31-23:59:59 was known as
2005-12-31-23:59:60.
However, it seems that our date(1) utility doesn't know about this. If
you ask it for the time difference between 2006-01-01 and 2005-12-31, it
still calculates the number of seconds as 24 * 60 * 60 and doesn't have
an extra second!
$ TZ=GMT; export TZ
$ echo $(( $(date -ju '+%s' 200601010100) - $(date -ju '+%s' 200512310100) ))
86400
$
Is this a bug?
----------------------------------------------------------------------
| Paul Goyette | PGP DSS Key fingerprint: | E-mail addresses: |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul%whooppee.com@localhost |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette%juniper.net@localhost |
----------------------------------------------------------------------
Home |
Main Index |
Thread Index |
Old Index