LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 04-02-2006, 10:43 PM   #1
matsko
Member
 
Registered: Dec 2005
Posts: 51

Rep: Reputation: 15
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, 12:18 AM   #2
haymaker2000
Member
 
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:

Code:
#ln -sf ../usr/share/zoneinfo/your/zone /etc/localtime
or
#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''.

Source: http://www.linuxsa.org.au/tips/time.html

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:
Code:
#mv /etc/localtime /etc/localtime_backup
#ln -s /usr/share/zoneinfo/your/zone /etc/localtime
Cheers

http://www.ihostnz.com
 
Old 04-03-2006, 01:00 AM   #3
matsko
Member
 
Registered: Dec 2005
Posts: 51

Original Poster
Rep: Reputation: 15
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...

Thanks
 
Old 04-03-2006, 01:11 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
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.
 
  


Reply


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 01:08 PM
Time keeps changing? threedguy Linux - Software 5 10-08-2003 09:05 PM
time keeps changing mcd Linux - Newbie 2 08-22-2003 08:12 AM
Changing time zone... tinaa Linux - General 3 07-11-2003 06:07 AM
Time keeps changing eternity1700 Linux - General 2 02-17-2003 12:06 AM


All times are GMT -5. The time now is 09:02 AM.

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