Jump to content
  • 0

How to Change Your Server Time


Green

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  61
  • Reputation:   0
  • Joined:  04/28/13
  • Last Seen:  

Sir, Can i Know How To Change my Server Time...

What Tool do i need to use And can u teach me step by step..thx

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

1. We can look at the current date and time of a CentOS server by typing "date" in the SSH terminal or PuTTy.exe.
time.jpg

2. You ll notice that it?s probably not what you want. CentOS uses the file /etc/localtime to determine what the timezone you want to use is. If the contents of that file aren?t what you?re looking for?we?ll need to replace it. First, lets get rid of that file since it?s wrong anyway. We?ll rename it to localtime.bak.
time2.jpg

3 .Since CentOS now no longer has a proper localtime file, you can run the date command again and see that it just uses the universal time now.

We need a new /etc/localtime file with the right stuff. Rather than make a new file, we?ll create a symlink to an already existing timezone file. They're all located in /usr/share/zoneinfo. Find the one you want in there. For this example, I?m setting the server to central time. So /usr/share/zoneinfo/Asia/Manila will work for me. Just find whichever timezone file corresponds to the one you want to set your server to.

Now, let's make that link.
time3.jpg

Run the date command again and you should be good to go!

4. Restart your server to take effect1. We can look at the current date and time of a CentOS server by typing "date" in the SSH terminal or PuTTy.exe.

time.jpg

2. You ll notice that it?s probably not what you want. CentOS uses the file /etc/localtime to determine what the timezone you want to use is. If the contents of that file aren?t what you?re looking for?we?ll need to replace it. First, lets get rid of that file since it?s wrong anyway. We?ll rename it to localtime.bak.
time2.jpg

3 .Since CentOS now no longer has a proper localtime file, you can run the date command again and see that it just uses the universal time now.

We need a new /etc/localtime file with the right stuff. Rather than make a new file, we?ll create a symlink to an already existing timezone file. They're all located in /usr/share/zoneinfo. Find the one you want in there. For this example, I?m setting the server to central time. So /usr/share/zoneinfo/Asia/Manila will work for me. Just find whichever timezone file corresponds to the one you want to set your server to.

Now, let's make that link.
time3.jpg

Run the date command again and you should be good to go!

4. Restart your server to take effect

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  61
  • Reputation:   0
  • Joined:  04/28/13
  • Last Seen:  

Thx A lot Patskie

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...