Date and time change in server

Description of your first forum.
Post Reply
babitaacharya644
Posts: 4
Joined: Wed Jan 21, 2015 4:17 pm

Date and time change in server

Post by babitaacharya644 » Thu May 14, 2015 9:31 am

Please help me,
How to modify default date and time zones for CentOS server?


Thanks

archangevictoria
Posts: 5
Joined: Wed Jan 21, 2015 4:14 pm

Re: Date and time change in server

Post by archangevictoria » Fri May 15, 2015 9:53 am

Hello
This command will help you out


Type the following commands as root:

cp /etc/localtime /root/old.timezone
rm /etc/localtime
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime

laurencecatherine741
Posts: 7
Joined: Wed Jan 21, 2015 4:11 pm

Re: Date and time change in server

Post by laurencecatherine741 » Wed May 20, 2015 10:30 am

To show the current timezone in the file /etc/timezone, use the command:

cat /etc/timezone

To change this to the U.S. Los Angeles time, we need to modify the /etc/timezone file.

First step: edit the /etc/timezone file via vim or nano.

Vi editor:

vi /etc/timezone

Nano editor:

nano /etc/timezone

Second step: modify the file as shown below:

America/Los_Angeles

set the timezone from the terminal using the TZ variable.

export TZ=America/Los_Angeles

Post Reply