999000000

Martijn van Oosterhout kleptog at svana.org
Wed Aug 29 09:19:17 EST 2001


On Wed, Aug 29, 2001 at 08:03:33AM +1000, Howard Lowndes wrote:
> Slightly wrong
> 
> $ date -u --date="1 jan 1970 + 1000000000 secs"
> Sat Sep  8 15:46:40 UTC 2001
> $ date  --date="1 jan 1970 + 1000000000 secs"
> Sun Sep  9 01:46:40 EST 2001

Something is wrong here, look:

$ date --date='Sep  8 15:46:40 UTC 2001' +%s
999964000
$ date --date='Sep  9 01:46:40 2001' +%s
999964000

I worked it out like follows:

$ perl -e 'print scalar(localtime(1_000_000_000)),"\n"'
Sun Sep  9 11:46:40 2001
$ date --date='Sep  9 11:46:40 2001' +%s
1000000000
$ perl -e 'print scalar(gmtime(1_000_000_000)),"\n"'
Sun Sep  9 01:46:40 2001
$ date --date='Sep  9 01:46:40 2001 UTC' +%s
1000000000

So who is right?

-- 
Martijn van Oosterhout <kleptog at svana.org>
http://svana.org/kleptog/
> It would be nice if someone came up with a certification system that
> actually separated those who can barely regurgitate what they crammed over
> the last few weeks from those who command secret ninja networking powers.




More information about the linux mailing list