1825801 Members
2718 Online
109687 Solutions
New Discussion

Re: TZ settings

 
Miguel Silva Rentes
Regular Advisor

TZ settings

Hi everyone!

I have a HP-UX 11.23 server and have set TZ to PWT0PST.

So far so good, but when the Summer Time or Winter Time arrives, will I get my machine with incorrect time (1h backwards or 1h forward)? Is there a way to set TZ to automatically change time at a given date?

Best regards,

Miguel Rentes
4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: TZ settings

>when the Summer Time or Winter Time arrives, will I get my machine with incorrect time (1h backwards or 1h forward)?

Only if there is an entry in for that value in /usr/lib/tztab. If there isn't, you'll follow the US rules.

>Is there a way to set TZ to automatically change time at a given date?

You can look at TZ under environ(5) but using tztab(4) is much easier.
James R. Ferguson
Acclaimed Contributor

Re: TZ settings

Hi Miguel:

Your TZ settings will transition your perception of time according to the rules of the entry. That is, your *local* time will change *relative* to Universal or Grenwich time. This will occur automatically and you should do nothing.

See the manpages for 'tztab(4)' and 'cron(1M)' for an explantion of the '/usr/lib/tztab' file and how it works. See particularly, the "Spring and Autumn Time Transitions" in the 'cron(1M)' manpages:

http://docs.hp.com/en/B3921-60631/tztab.4.html

http://docs.hp.com/en/B3921-60631/cron.1M.html

Regards!

...JRF...

Miguel Silva Rentes
Regular Advisor

Re: TZ settings

Thank you very much!

I saw what I had in /usr/lib/tztab and have (among other entries) this one:

# Portuguese Winter Time, Portuguese Summer Time
PWT0PST
0 2 25-31 3 1983-2038 0 PST-1
0 1 25-31 10 1983-2038 0 PWT0

as I'm using PWT0PST for TZ, this tells me TZ gets changed in March (at 2 am) and in October (at 1 am), correct?

Best regards,

Miguel Rentes
Dennis Handly
Acclaimed Contributor

Re: TZ settings

>this tells me TZ gets changed in March (at 2 am) and in October (at 1 am), correct?

No need to think, just use Clay's dst.pl script:
$ TZ=PWT0PST dst.pl
Sun Mar 30 00:59:59 PWT 2008 --> Sun Mar 30 02:00:00 PST 2008
Sun Oct 26 01:59:59 PST 2008 --> Sun Oct 26 01:00:00 PWT 2008

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1170751