Difference between revisions of "How to change server time zone"
From Kolmisoft Wiki
Jump to navigationJump to search
Line 12: | Line 12: | ||
cp /usr/share/zoneinfo/Europe/Dublin /etc/localtime | cp /usr/share/zoneinfo/Europe/Dublin /etc/localtime | ||
Update /etc/sysconfig/clock to new timezone, in this example it would look like this: | |||
$> cat /etc/sysconfig/clock | |||
ZONE="Europe/Dublin" | |||
Note: if /etc/sysconfig/clock file is not updated, certain commands (for example glibc package update) will revert timezone to the one defined in /etc/sysconfig/clock, so do not skip this step. | |||
Next step, change hardware clock time to your localtime: | Next step, change hardware clock time to your localtime: |
Revision as of 08:24, 11 August 2016
Check current time by entering
date
into console.
Available timezones could be found in /usr/share/zoneinfo
You have to choose correct timezone file and copy it on top of /etc/localtime file.
Example if your server is in Dublin , Europe:
cp /usr/share/zoneinfo/Europe/Dublin /etc/localtime
Update /etc/sysconfig/clock to new timezone, in this example it would look like this:
$> cat /etc/sysconfig/clock ZONE="Europe/Dublin"
Note: if /etc/sysconfig/clock file is not updated, certain commands (for example glibc package update) will revert timezone to the one defined in /etc/sysconfig/clock, so do not skip this step.
Next step, change hardware clock time to your localtime:
hwclock --systohc
Check hardware clock time by running:
hwclock --show
Then restart asterisk, if this doesn't help, restart your server.