Date command not returning proper time on DST boundary cross over
Issue
-
When our application executed
date -d yesterday +%F, instead of showing yesterday's output in the file, we could see day before yesterday's date in the file. -
Around 00:30 EST, when the user executed date '+%Y%m%d %H%M%S' -d '-1 day', output was 20130309. When the same command executed around 01:15 EST, 20130310 was returned.
-
NTPis in use and working correctly:
Mar 10 23:46:19 hostname1 ntpd[12233]: synchronized to X.X.X.X, stratum 2
Mar 11 00:03:56 hostname1 ntpd[12233]: synchronized to Y.Y.Y.Y, stratum 2
Mar 11 00:38:06 hostname1 ntpd[12233]: synchronized to Z.Z.Z.Z, stratum 2
Mar 11 00:45:07 hostname1 ntpd[12233]: synchronized to X.X.X.X, stratum 2
Mar 11 01:18:47 hostname1 ntpd[12233]: synchronized to Z.Z.Z.Z, stratum 2
Mar 11 01:46:23 hostname1 ntpd[12233]: synchronized to X.X.X.X, stratum 2
Environment
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.