GNU bug report logs -
#40958
date command give current time zone regardless of seconds since epoch requested.
Previous Next
Reported by: GNAT <gnat <at> 1.gnat.bgcomp.co.uk>
Date: Wed, 29 Apr 2020 10:26:01 UTC
Severity: normal
Tags: notabug
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
I am going to hazard a guess and say this is the expected behaviour, but I cannot find anything though goog.
The date command has a number of switches, one of which is -d where you give it the number of seconds since epoch, as in "date -d <at> 1234" or "date --date @1234".
Additionally, you can get it to return as any string you want to, as in "date -d <at> 1234 "+%c %z %Z"
Both return "Thu Jan 1 01:20:34 BST 1970" or "Thu Jan 1 01:20:34 +0100 BST 1970" for the UK.
/etc/localtime is set to /usr/share/zoneinfo/Europe/London.
That's wrong, it should give "Thu Jan 1 00:20:34 1970 +0000 GMT".
After all, in January, the UK is not in daylight saving time at the beginning of January.
It therefore gives you the current daylight saving time status, rather than what it should be at the time requested.
I assume currently, this will give erroneous results for any requests in daylight saving.
This bug report was last modified 5 years and 25 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.