Unix timestamp anomaly
Hi,
I am seriously puzzled by seeing the below anomaly:
When I want to fetch 7 days ago date at around 12:48 AM on April 1 it is displaying the date as 24th March which is wrong (should be Mar 25).
Again when I am issuing the same expression at around 1:15 AM on the same day i.e. Apr 1 it is displaying correctly as Mar 25. Point to be noted that my Linux box is following CEST timezone and on Mar 29th out ntp server changed to DST timings.Attached are the commands and results I executed and obtained.
Thanks in advance,
Subhajit
-bash-4.1$ echo $(date +"%Y-%m-%d" --date="7 days ago")
2015-03-24
-bash-4.1$ echo $(date)
Wed Apr 1 00:48:36 CEST 2015
---------------------------------------------------------------------------
-bash-4.1$ echo $(date +"%Y-%m-%d" --date="7 days ago")
2015-03-25
-bash-4.1$ date
Wed Apr 1 01:15:35 CEST 2015
I am using RedHat Linux 6 version
|