May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

How to change your CentOS server timezone

How to change your CentOS server timezone

Timezone data (tzdata) is stored in /usr/share/zoneinfo.

To change your CentOS server’s timezone, simply run the following command based up on the examples below:

Example 1: set time zone to Melbourne, Australia
cp /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
Example 2: set time zone to UTC
cp /usr/share/zoneinfo/UTC /etc/localtime

To confirm the time set on your system, run the date command, example:

date
Thu Jul 26 09:53:11 EST 2012

If you want to sync this time to your hardware (BIOS) clock, run the following command:

hwclock --systohc

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>