BeginLinux Community
Welcome Guest   [Register]  [Login]
 Subject :Setting Time on Server.. 2009-06-18 05:32:39 
joe
Joined: 2009-05-28 06:21:09
Posts: 19
Location
My time is off on my server, how do I fix that without wrecking my server? And is there a way for me to make it work permanent?
IP Logged
 Subject :Re:Setting Time on Server.. 2009-06-18 05:38:49 
MikeW
Rookery Moderator
Joined: 2009-06-03 13:47:46
Posts: 34
Location
You can use the date command for checking and for fixing your time and date. It is not an uncommon issue for motherboards to lose time as they are just not always accurate.

If you want to check the time do the command:

date
Thu Jun 18 05:32:26 MDT 2009

You will get an output that shows the day(Thursday) the date and then the time. The time is hour, minute, second and then the time zone(MDT is Mountain). Finally you will see the year.

To change the date use the same command with the -s option and the time and date you want to change to in double ".

date -s "06/18/2009 5:21"
Thu Jun 18 05:21:00 MDT 2009

Note that the input order is a little different than the output but when you look at the example it is clear enough.
IP Logged
 Subject :Re:Setting Time on Server.. 2009-06-18 06:10:13 
MikeW
Rookery Moderator
Joined: 2009-06-03 13:47:46
Posts: 34
Location
Syncing Your Desktop to Internet Time Servers

NTP is a Network Time Protocol that connects your local machine to a remote server to configure your local time correctly. Often users do not realize that their machine is actually making these remote connections.

In order to synchronize to Internet time servers you will need to install NTP support. On Centos this is done with:

yum install ntp

Now you can update using the ntp server or you can run this command on a cron job:
ntpdate pool.ntp.org
18 Jun 08:08:18 ntpdate[2552]: step time server 66.79.167.34 offset -3815.767210 sec
IP Logged
Page # 


Powered by ccBoard