Operating System - HP-UX
1833831 Members
2390 Online
110063 Solutions
New Discussion

Daylight Saving Time patch PHCO_34668 is not working.

 
Irine Gibilisco
Advisor

Daylight Saving Time patch PHCO_34668 is not working.

I have an HP-UX 11.11 server, to which I applied PHCO_34668 patch to modify the automatic Daylight Saving Time switch/over that begins in 2007. My time zone is EST5EDT. I then tested the various time combinations, and found that the November 'fall behind' is not happening as expected. These are commands I ran:

> date 0402015606 # Old convention - worked OK
> date 0311015607 # New convention - worked OK

However,

> date 1104015607 # New convention - DID NOT WORK

And
> date 1029015606 # Old convention - DID NOT WORK

Am I doing something wrong, or is the patch not working?
UNIX is forever.
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: Daylight Saving Time patch PHCO_34668 is not working.

Note that 1104015607 is an ambiguous time specification since it is not possible to know if you specified EST or EDT and both would occur on 04-Nov-2007. In any event, it is rather dangerous to change times like you have been doing (especially setting the time backward when you are finsished) as the system and databases could have tons of invalid file timestamps. A much safer way to test your box is via the attached Perl script, dst.pl. For example, dst.pl -y 2006 will display the exact time transitions for 2006 for yourt current TZ setting. Invoke as dst.pl -u for full usage. The good news is that because this Perl script uses the same underlying libc() functions that all UNIX applications and commands (like date) use, if this script works then everything else will work and it doesn't need to set the system time ahead and back to test.

If it ain't broke, I can fix that.
Irine Gibilisco
Advisor

Re: Daylight Saving Time patch PHCO_34668 is not working.

I spoke to HP support, and, apparently I need to set the starting time to over 1 hour before the time change. When I did
> date 1104005607
the time rolled over correctly from 2am to 1am.
By the way, all the databases and applications were brought down for this time testing, to prevent database time stamp corruption.
UNIX is forever.
Irine Gibilisco
Advisor

Re: Daylight Saving Time patch PHCO_34668 is not working.

For rolling time backwards, set the start testing time to over an hour before.
UNIX is forever.
A. Clay Stephenson
Acclaimed Contributor

Re: Daylight Saving Time patch PHCO_34668 is not working.

Yes, that works because the time specification is not ambiguous. In any event, the Perl script is a much safer and easier test --- and note, your test did not test all TZ setting. A UNIX box could have connections from all over the world; each with its own unique TZ setting. It's much easier to do something like this:

TZ=EST5EDT dst.pl
TZ=CST6CDT dst.pl
...
...

and test as many TZ's as you like -- safely.

dst.pl knows nothing about tztab; it doesn't read the file. It just uses the underlying date functions. It will even work on a Windows box if Perl is installed.
If it ain't broke, I can fix that.
robin uy
Occasional Contributor

Re: Daylight Saving Time patch PHCO_34668 is not working.

Can someone point me to where the dst.pl script is?
Patrick Wallek
Honored Contributor

Re: Daylight Saving Time patch PHCO_34668 is not working.

Look at Clays first post.

It is attached.