November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

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>