pavement

Time Zones

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
 
m (Reverted edit of 85.255.114.132, changed back to last version by Dave)
 
(One intermediate revision by one user not shown)
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 Meridian 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:
+
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'''

Latest revision as of 12:42, 15 January 2006

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.

Personal tools