Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-02-2006, 11:43 PM   #1
Registered: Dec 2005
Posts: 51

Rep: Reputation: Disabled
Changing the time...

how do I change the time of my linux server. Its hosted locally in an eastern timezone, however the server itself is dedicated to a pacific timezone.

How do I do this in ssh?

Note: I have full moderation and ownership of the server
Old 04-03-2006, 01:18 AM   #2
Registered: Jan 2006
Location: New Zealand
Distribution: Ubuntu 5.10 (Breezy), Debian 3.1 (Sarge)
Posts: 37

Rep: Reputation: 15
Setting your timezone

The timezone under Linux is set by a symbolic link from /etc/localtime[1] to a file in the /usr/share/zoneinfo[2] directory that corresponds with what timezone you are in. For example, since I'm in South Australia, /etc/localtime is a symlink to /usr/share/zoneinfo/Australia/South. To set this link, type:

#ln -sf ../usr/share/zoneinfo/your/zone /etc/localtime
#ln -s /usr/share/zoneinfo/your/zone /etc/localtime
Replace your/zone with something like Australia/NSW or Australia/Perth. Have a look in the directories under /usr/share/zoneinfo to see what timezones are available.

[1] This assumes that /usr/share/zoneinfo is linked to /etc/localtime as it is under Red Hat Linux.

[2] On older systems, you'll find that /usr/lib/zoneinfo is used instead of /usr/share/zoneinfo. See also the later section ``The time in some applications is wrong''.


If you can't find the timezone you want, have a look in /usr/share/zoneinfo/Etc/ . There should be all the timezones that are missing.

If the timezone exists already, just move it with:
#mv /etc/localtime /etc/localtime_backup
#ln -s /usr/share/zoneinfo/your/zone /etc/localtime
Old 04-03-2006, 02:00 AM   #3
Registered: Dec 2005
Posts: 51

Original Poster
Rep: Reputation: Disabled
Yeah I am using CentOs4.2 which is the same thing as RedHat, so it shouldn't be a problem...

Do I just reboot the server afterwards... Note that I am running php and mysql so it should be restarted so those two will then boot up on the correct time...

Old 04-03-2006, 02:11 AM   #4
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,340

Rep: Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745
Probably, we had to reboot mysql etc to get it to notice the change when South Aus was affected by changing clocks for the Commonwealth games early.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing time ethics Fedora 9 08-02-2005 02:08 PM
Time keeps changing? threedguy Linux - Software 5 10-08-2003 10:05 PM
time keeps changing mcd Linux - Newbie 2 08-22-2003 09:12 AM
Changing time zone... tinaa Linux - General 3 07-11-2003 07:07 AM
Time keeps changing eternity1700 Linux - General 2 02-17-2003 01:06 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration