Time Zones
Line 1: | Line 1: | ||
− | The local handling of time zones on your server is set by the file '''/etc/localtime'''. (If /etc/localtime is not present, the system will default to using Greenwich | + | The local handling of time zones on your server is set by the file '''/etc/localtime'''. (If /etc/localtime is not present, the system will default to using Greenwich Mean Time.) The easiest way to get the proper info into the /etc/localtime file is usually to copy the appropriate time zone info file from /usr/share/zoneinfo: |
ph34r# '''ls /usr/share/zoneinfo''' | ph34r# '''ls /usr/share/zoneinfo''' |
Revision as of 11:58, 18 October 2004
The local handling of time zones on your server is set by the file /etc/localtime. (If /etc/localtime is not present, the system will default to using Greenwich Mean Time.) The easiest way to get the proper info into the /etc/localtime file is usually to copy the appropriate time zone info file from /usr/share/zoneinfo:
ph34r# ls /usr/share/zoneinfo Africa Australia Etc MET WET America CET Europe MST posixrules Antarctica CST6CDT Factory MST7MDT zone.tab Arctic EET GMT PST8PDT Asia EST HST Pacific Atlantic EST5EDT Indian SystemV
I happen to live in a region that uses Eastern Standard Time and does observe Daylight Savings Time at the appropriate times of the year, so:
ph34r# cp /usr/share/zoneinfo/EST5EDT /etc/localtime
And bingo, my server is now running on Eastern Standard (or Daylight, as appropriate) Time. No rebooting, HUPping, or other sorts of restarting is necessary. WARNING: this will immediately change the effective time on your system clock for purposes of any scheduled jobs, system or user. So be prepared for tons of jobs to start running at once if you jump the clock 5 hours in one fell swoop like this.