Bug ID | 1170780 |
---|---|
Summary | Date command always gives current time zone when asked for any -d@??? |
Classification | openSUSE |
Product | openSUSE Distribution |
Version | Leap 15.1 |
Hardware | Other |
OS | Other |
Status | NEW |
Severity | Normal |
Priority | P5 - None |
Component | Other |
Assignee | screening-team-bugs@suse.de |
Reporter | opensuse@1.opensuse.bgcomp.co.uk |
QA Contact | qa-bugs@suse.de |
Found By | --- |
Blocker | --- |
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". This returns "Thu Jan 1 01:20:34 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 +0100 BST". Additionally, you can get it to return as any string you want to, as in "date -d@1234 "+%c %z %Z"" which should give "Thu Jan 1 01:20:34 1970 +0000 GMT". After all, in January, the UK is not in daylight saving time. However, what it does give you is "Thu Jan 1 01:20:34 1970 +0100 BST". It therefore gives you the current daylight saving time status, rather than that requested. I assume currently, this will give erroneous results for any requests in daylight saving.