Friday, July 15, 2011

Setting date and time on CentOS

Well most linux should also follow the format.
The syntax is

$ sudo date MMDDhhmmYYYY

LETTER CODES
MM - Two digit month number
DD - Two digit date
hh - Two digit 24 hour system hour
mm - Two digit minute
YYYY - Four digit year code


if you are already root, you can ignore the sudo

Here is a valid example command, where I am login as root already

$ date 071509442011

You should see the confirmation date after you executed that command, and will be similar to this
Fri Jul 15 09:44:00 PHT 2011

to confirm just enter date command
$ date

ADDITIONAL INFORMATION
You might want your bios clock to adjust to your new OS clock, so that when you rebooted, your OS will use the newly adjusted date and time.

$ hwclock --systohc

Maybe I will try to post on how to set NTP. But for now this is just my personal notes. Hope someone find it useful.

No comments: