Mostly Linux & Python syntax notes and hyperlinks.

Thursday, March 18, 2010

Linux: setting the system time & date

I've had to manually reset the date on our Linux VM every day:
su -c "date MMDDHHMMYYYY"
The weird thing is the order: Month Day Hour Minute, then year.

e.g., today at 9:55am
su -c "date 031809552010"
I seem to recall when we first noticed that time was passing slowly on the VM that there were some possibly better solutions suggested by VMWare. I just haven't the time to work on them.

(Update May 2013:) The lazy way to collect the correct string to use is to log into another Linux box and type 
 date +%m%d%H%M%Y
That will return the string "052416532013" which you can copy and paste into the command on the server that needs its time updated.
$ su -c "date 052416532013"
Password:
Fri May 24 16:53:00 EDT 2013

No comments:

Post a Comment

Blog Archive