Results 1 to 5 of 5
$ cat test.sh
echo `date +'%Y%m%d %T'` " c start"
echo `date +'%Y%m%d %T'` " c done "
I run the script above for many time and got the wired ...
- 05-10-2009 #1Just Joined!
- Join Date
- May 2009
- Posts
- 3
Help me about time error
$ cat test.sh
echo `date +'%Y%m%d %T'` " c start"
echo `date +'%Y%m%d %T'` " c done "
I run the script above for many time and got the wired error for linux time:
$ sh test.sh
20090510 15:58:23 c start
20090510 15:58:23 c done
$ sh test.sh
20090510 15:58:30 c start
20090510 15:58:30 c done
$ sh test.sh
20090510 15:58:30 c start
20090510 15:58:30 c done
$ sh test.sh
20090510 15:58:31 c start
20090510 15:58:31 c done
$ sh test.sh
20090510 15:58:31 c start
20090510 15:58:31 c done
$ sh test.sh
20090510 15:58:32 c start
20090510 15:58:32 c done
$ sh test.sh
20090510 15:58:33 c start
20090510 15:58:33 c done
$ sh test.sh
20090510 15:58:33 c start
20090510 15:58:33 c done
$ sh test.sh
20090510 17:11:52 c start <-------------see this
20090510 15:58:34 c done
If I repeatedly run "date" it will get the same error, and this error seems to be happen randomly without any pattern to analysis.
Any one can help me about this ? thank alot~
- 05-10-2009 #2Just Joined!
- Join Date
- May 2009
- Posts
- 3
date version
date (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
- 05-10-2009 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Neat! You've discovered time travel!

Really, I've never seen this. My date is the same version as yours.
Ok. I made the same test.sh that you show and tried it a LOT of times. No problems here. Maybe it is a hardware problem? Or an ntp problem? Don't know, but as I said, I cannot reproduce it on my system - Intel S5000XVN mb, dual E5450 xeon processors, 8GB RAM, running CentOS 5.3 with latest kernel, updated yesterday.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 05-11-2009 #4Just Joined!
- Join Date
- May 2009
- Posts
- 3
- 05-11-2009 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
As I suggested, this could simply be a glitch in the real-time clock of the system that exhibits this behavior. I would also suggest that you run extended diagnostics on the system to see if there is a problem with the motherboard and clock.
Re. your comment that it doesn't occur on other Linux. Do you mean that it doesn't happen with another version of Linux running on the same computer system? Or that it doesn't happen on another computer system running Linux? The distinction is important.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
