Operating System - HP-UX
1833777 Members
1816 Online
110063 Solutions
New Discussion

How to know that my time will change correctly this weekend?

 
SOLVED
Go to solution
John Chaff
Advisor

How to know that my time will change correctly this weekend?

Hello Experts:

I have users in Eastern, Central, and Pacific timezones. How can I know that my times will change correctly this weekend? I have looked at /usr/lib/tztab for these timezones and it looks okay but is there a command that will test this? Date doesn't seem to have an option for this.

TIA,
John
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: How to know that my time will change correctly this weekend?

The time really doesn't change. All UNIX boxes in the known universe simply count seconds since the Earth was created on 1-Jan-1970 00:00:00 UTC. What does change is the way these seconds are displayed. The attached Perl script will do the trick and because it uses the same underlying functions (localtime(), strftime()) that other utilities like date use, it's a very good test.

"dst.pl -n" will do the trick. Invoke as "dst.pl -u" for full usage.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: How to know that my time will change correctly this weekend?

Oh, I should add to test for your TZ's, do this:

TZ=EST5EDT dst.pl -n
TZ=CST6CDT dst.pl -n
TZ=PST8PDT dst.pl -n

dst.pl -n will test for the default (actually the current) setting of TZ.
If it ain't broke, I can fix that.
John Chaff
Advisor

Re: How to know that my time will change correctly this weekend?

Hi A. Clay:

Thanks. This is a great script! I especially like the -d option which shows the amount of time left until the time change.

Thanks,
John