1753451 Members
6102 Online
108794 Solutions
New Discussion юеВ

/etc/localtime

 
Wilfred Chau_1
Respected Contributor

/etc/localtime

Does anyone know how the localtime file is used?

I know when the system reboots, this file will be read to adjust the HW clock. But what if the system is up and running?

We have a box which a DST patch was installed but the localtime file was not updated. I am afraid the system clock will move forward next Sunday.
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: /etc/localtime

Hi Wilfred:

The manpages for 'hwclock' in the section titled "Clocks in a Linux System" nicely explain this.

Regards!

...JRF...
Ivan Ferreira
Honored Contributor

Re: /etc/localtime

The /etc/localtime file is a copy of the timezone file located in /usr/share/zoneinfo. When you modify the timezone to update the DST changes, the /usr/share/zoneinfo/ is updated and you should copy the file to /etc/localtime.

cp /usr/share/zoneinfo/ /etc/localtime

You can check DST rules with zdump -v
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: /etc/localtime

Shalom,

A possible solution to this would be to connect your system to an ntp time source. There probably is one on you network you can configure in ntp.conf

If you installed the DST patch and the system clock already moved forward its not going to do it again.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Wilfred Chau_1
Respected Contributor

Re: /etc/localtime

thanks all.

What is the different between these 2 commands?


zdump -v US/Pacific

zdump -v /etc/localtime

Ivan Ferreira
Honored Contributor

Re: /etc/localtime

The first command will open the zone file in /usr/share/zoneinfo, the second command will open /etc/localtime, if the files are equal as it should, you should get no differences in the rules.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Wilfred Chau_1
Respected Contributor

Re: /etc/localtime

thank you all