How to set correct time zone on OpenVZ server (Centos VPS )
Hi, this very quick tutorial will teach you how to set the correct time zone on your server.
Nine out of ten times when your new server gets deployed it comes with the incorrect time zone for your location, or your provider forgets to set the correct hardware clock so to check your current time and date simply type date
in your temrminal which should return something like:
[root@Hades ~]# date Sat Apr 18 13:18:40 EDT 2015
From this, we can easily deduct that the time zone is set to EDT and U.K is in the GMT time zone so to set it right we type tzselect
which will return the following:
`Please select a continent or ocean.
- Africa
- Americas
- Antarctica
- Arctic Ocean
- Asia
- Atlantic Ocean
- Australia
- Europe
- Indian Ocean
- Pacific Ocean
- none - I want to specify the time zone using the Posix TZ format.
From there we can either select our continent, country and city to set the correct time zone or we can select option 11 where we can type our time zone like
GMT-1` meaning greenwhich mean time plus one hour ahead. After that we press enter which should confirm out selection like this:
awk: cmd. line:4: warning: escape sequence `\.' treated as plain `.'
The following information has been given:
TZ='GMT-1'
Therefore TZ='GMT-1' will be used.
Local time is now: Sat Apr 18 18:31:40 GMT 2015.
Universal Time is now: Sat Apr 18 17:31:40 UTC 2015.
Is the above information OK?
1) Yes
2) No
#?
We then confirm our selection and your time zone and date should be all set!
Marcel