Hi All,
I tryied the following commands (see below) on several Linux kernels, it looks there are some bugs exist in
date build-in function I am not sure about this, can anyone test the command on Fedora, I do not have Fedora available at the moment.
Thanks.
On PC cygwin
hzs@work
$ uname -a
CYGWIN_NT-5.1 work 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin
hzs@work
$ date -d "20071101 73 hours" +%Y-%m-%d_%H:00:00
2007-11-04_01:00:00
hzs@work
$ date -d "20071101 74 hours" +%Y-%m-%d_%H:00:00
2007-11-04_01:00:00
hzs@work
$ date -d "20071101 75 hours" +%Y-%m-%d_%H:00:00
2007-11-04_02:00:00
On CentOS
hzs@work1
$ uname -a
Linux work1
2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 26 14:14:47 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
hzs@work1
$ date -d "20071101 73 hours" +%Y-%m-%d_%H:00:00
2007-11-04_01:00:00
hzs@work1
$ date -d "20071101 74 hours" +%Y-%m-%d_%H:00:00
2007-11-04_02:00:00
hzs@work1
$ date -d "20071101 75 hours" +%Y-%m-%d_%H:00:00
2007-11-04_03:00:00
Another CentOS different kernel
Linux work2
2.6.18-92.1.6.el5 #1 SMP Wed Jun 25 13:49:24 EDT 2008 i686 i686 i386 GNU/Linux
[1244][hzs@work2]$ date -d "20071101 73 hours" +%Y-%m-%d_%H:00:00
2007-11-04_01:00:00
[1244][hzs@work2]$ date -d "20071101 74 hours" +%Y-%m-%d_%H:00:00
2007-11-04_01:00:00
[1244][hzs@work2$ date -d "20071101 75 hours" +%Y-%m-%d_%H:00:00
2007-11-04_02:00:00