Operating System - HP-UX
1819805 Members
3072 Online
109607 Solutions
New Discussion юеВ

Re: Utility to display time change?

 
SOLVED
Go to solution
Neil Edwards
Advisor

Utility to display time change?

Hello Experts,

Does anyone know of a utility that displays the next change to/from Daylight Saving Time? I may have to write something that looks at /usr/lib/tztab but I am hoping there is already a command.

TIA,
Neil

It wasn't me.
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Utility to display time change?

I think you're writing the utility sir.

You might be able to mess with caldj.sh to get results. It can be found on http://www.hpux.ws/merijn

Every once in a while the government mandates a change in the date of the switch on time change, so I use ntp to keep the servers on track.

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
Elmar P. Kolkman
Honored Contributor

Re: Utility to display time change?

grep $(echo $TZ | sed "s|$(date +%Z)[-]*[0-9]*||") /usr/lib/tztab | sort -nk 5 | tail -1

This will give you the month and possible days for the next DST change.
Every problem has at least one solution. Only some solutions are harder to find.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Utility to display time change?

Well Neil, as Foghorn Leghorn once said "I always keep my feathers numbered for just such an emergency. Here is a script (actually a fairly recently improved Perl script) from an earlier version I posted that will do just that.

dst.pl -n will display a formatted date/date of the next time change

dst.pl -n -e will display the epoch seconds of the next time change.

dst.pl -d will display the fractional days remaining until the next time change and dst.pl -d -e will display integer days until the next time change.

Invoke as dst.pl -u for full usage.



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

Re: Utility to display time change?

Ooops Neil, I forgot to mention that this puppy will also works on Windows if you have on the the free Perls installed.
If it ain't broke, I can fix that.
Neil Edwards
Advisor

Re: Utility to display time change?

Thanks A. Clay. That did just what I needed! I even tried it on my PC and your Perl script worked there too!

Thanks,
Neil
It wasn't me.