I have an AWS EC2 server running Amazon Linux (like rhel fedora) which does not know how to tell time, or is somehow not accounting for Daylight Savings Time. This makes all of my timestamps off by 1 hour.
[ec2-user@ip-xxx-xx-xx-xxx ~]$ date && date -u
Thu Oct 24 17:19:56 EST 2019
Thu Oct 24 22:19:56 UTC 2019
The problem with that output is that (at the time of the command), the actual time in EST was 18:19:56.
Again, UTC time is correct, I've set my /etc/localtime link to America/Detroit, but it still gloms onto UTC-5 and does not adjust an hour for DST.
[ec2-user@ip-xxx-xx-xx-xxx ~]$ sudo hwclock --debug
hwclock from util-linux 2.23.2
Using /dev interface to clock.
Last drift adjustment done at 1571955488 seconds after 1969
Last calibration done at 1571955488 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2019/10/24 22:23:43
Hw clock time : 2019/10/24 22:23:43 = 1571955823 seconds since 1969
Thu 24 Oct 2019 05:23:43 PM EST -0.689737 seconds
All of my tzdata is up-to-date. No updates pending on yum.
[ec2-user@ip-xxx-xx-xx-xxx ~]$ echo $TZ
[ec2-user@ip-xxx-xx-xx-xxx ~]$ ls -l /etc/localtime
lrwxrwxrwx 1 root root 23 Dec 8 2015 /etc/localtime ->
/usr/share/zoneinfo/EST
I'm at a loss. Does anybody know what could be going on? Does Linux not adjust for DST?
echo $TZplease. Should be empty. And I think you're still on EDT rather than EST. It's strange your server is reporting the wrong label.TZ=US/Eastern datereturns your correct local time, or the one that's wrongly an hour off?America/New_Yorkis the standard option. Naively, I had assumed all the "Eastern" zones were equivalent. It hadn't even occurred to me to try swapping them.