Operating System - HP-UX
1846872 Members
2840 Online
110256 Solutions
New Discussion

How to test Daylight Savings Time settings for 2007?

 
SOLVED
Go to solution
Robert Fisher_1
Frequent Advisor

How to test Daylight Savings Time settings for 2007?


Hello HP-UX Experts,

I have just entered my changes for the 2007 Daylight Savings Time rules in /usr/lib/tztab. Is there a way to test these changes without actually changing the system date? I am running Oracle and I have read that it is very bad to change the date backwards.

Thanks,
Bob

13 REPLIES 13
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: How to test Daylight Savings Time settings for 2007?

First of all, Bob, it's not Daylight Savings Time; it's Daylight Saving Time. And yes, you are correct it's not nice to set the date backwards. Customers get a little confused when Transaction No. 100 occurs befor Transaction No 99. The good news is that I do have an answer for you.

Execute the attached Perl script, dst.pl.

Without arguments, it works on the current year. With -y 2007, it will display the exact second before and after the transition.

e.g.
dst.pl -y 2007

Invoke as dst.pl -u for full usage.


The good news is that this Perl code uses the same underlying libc date routines that all the UNIX commands do so that if this works, everything will work as planned.

If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: How to test Daylight Savings Time settings for 2007?

Ooops, I should add that you can test multiple TZ values thusly:

TZ=EST5EDT dst.pl -y 2007
TZ=CST6CDT dst.pl -y 2007
TZ=MST7MDT dst.pl -y 2007
TZ=PST8PDT dst.pl -y 2007

Oh, and if you have Perl installed on Windows it works there as well. I'm gonna bet that them there Windows boxes will take more than just a tztab change (iffn that had one) to fix themselves.
If it ain't broke, I can fix that.
Robert Fisher_1
Frequent Advisor

Re: How to test Daylight Savings Time settings for 2007?

Hi A. Clay,

That's a very useful scripts!

Thanks,
Bob
Nobodybutme
New Member

Re: How to test Daylight Savings Time settings for 2007?

Hi All,

Does anyone know the actual dates that we will be doing this? I believe the 'spring ahead' is in March of 2007... what about the 'fall beihind' date?

thanks,
Cheryl
Patrick Wallek
Honored Contributor

Re: How to test Daylight Savings Time settings for 2007?

Jeff Carlin
Frequent Advisor

Re: How to test Daylight Savings Time settings for 2007?

A. Clay, thanks for the perl script to show the planned change. Don't be too hard on people that put the "s" on saving some of the man pages in HP also call it Daylight Savings Time! ;-)
Where wisdom is called for, force is of little use. --Of course, a hammer does wonders for relieving stress.
Geoff Wild
Honored Contributor

Re: How to test Daylight Savings Time settings for 2007?

March 11, 2007 2am

Nov 3, 2007 2 am

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Geoff Wild
Honored Contributor

Re: How to test Daylight Savings Time settings for 2007?

Sigh....I meant the Sunday - not Saturday....

March 12 2 am and Nov 4 2 am...
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Garry_2
Valued Contributor

Re: How to test Daylight Savings Time settings for 2007?

you were right the first time

DST On: Mar 11, 2007 at 01:59:59 + one second
and
DST Off:Nov 4, 2007 at 01:59:59 + 1



I run the script (on windows) and get:

C:\temp\FX-Down>273155.pl -y 2007
Sun Mar 11 01:59:59 Mountain Standard Time 2007 --> Sun Mar 11 03:00:00 Mountain Standard Time 2007
Sun Nov 04 01:59:59 Mountain Standard Time 2007 --> Sun Nov 04 01:00:00 Mountain Standard Time 2007

The info is correct except the 3/11 03:00 still shows "Mountain Standard Time"

don't know perl well enough to figure out why.

Thanks for the script. I also posted a java script to check java at:

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

--Garry
Pierrot_2
Contributor

Re: How to test Daylight Savings Time settings for 2007?

Clay,

How would you replace the "our" in line 184, it's deprecated on some of my systems
A. Clay Stephenson
Acclaimed Contributor

Re: How to test Daylight Savings Time settings for 2007?

Do a man "Getopt::Std". That will tell you your options if you do not want to use "our" in this context.
If it ain't broke, I can fix that.
Sundar_7
Honored Contributor

Re: How to test Daylight Savings Time settings for 2007?

Try this


$ more main.C

#include
#include "String.h"
#include "Time.h"

int main(int ac, char **av)
{
Time tm;

// March 11, 2007 - day that new savings time takes effect.
tm = Time(2007, Time::march, 11, Place::eastern()) +
Duration::hours(12);
cout << tm.make_string("%D %T %Z", Place::eastern())
<< "\n\n";
}

Build:

$ aCC main.C -I/opt/aCC/include -I/opt/aCC/include_std -I/opt/aCC/include/SC
-L /opt/aCC/lib -l++ -o my2k7

Execution:

On a non C++ patched system - BAD

$ my2k7
03/11/07 12:00:00 EST

On a patched system - GOOD

$ my2k7
03/11/07 13:00:00 EDT

BTW, not sure if you are aware, you share the name with one of the all time chess legends !! :-)
Learn What to do ,How to do and more importantly When to do ?
Dennis Handly
Acclaimed Contributor

Re: How to test Daylight Savings Time settings for 2007?

>Sundar: $ aCC main.C -I/opt/aCC/include -I/opt/aCC/include_std -I/opt/aCC/include/SC
-L /opt/aCC/lib -l++

You should only be using -I/opt/aCC/include/SC. The rest of the -Is and -L should be removed.
I.e. you should never specify default aCC paths.