Subject: date command give current time zone regardless of seconds since epoch requested.

From: GNAT <[email-masked]>
Date: Wed, 29 Apr 2020 09:40:19 +0100

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@1234" or "date --date @1234".

Additionally, you can get it to return as any string you want to, as in "date -d@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.