Operating System - HP-UX
1855749 Members
1435 Online
104103 Solutions
New Discussion

Re: Will my system change time correctly?

 
SOLVED
Go to solution
Derek Card
Advisor

Will my system change time correctly?

Hi,

Anybody know a way to check if the system will correctly change time this weekend? I guess I could use the date command to set the time forward and then set it back.

TIA,
Derek
6 REPLIES 6
Chris Vail
Honored Contributor

Re: Will my system change time correctly?

Don't bother. Unix systems have been dealing with time changes for decades now. You'll prolly get an email telling you that the time change will take place. Read it and delete it. Thats all the interaction you should need with the system. It'll change just fine.

This is only an issue where you have real-time data with time stamps coming in. It won't make a bit of difference to the OS, but your applications could hiccup, as there would be no data with timestamps from 2AM until 3 AM. Even with this, there is little problems. The problems come in the Fall when timestamps between 2AM and 3AM are duplicated.

Otherwise: you can just about ignore this.

Chris
Jeroen Peereboom
Honored Contributor

Re: Will my system change time correctly?

Derek,my first impression was: you're too late.But you don't live in Europe!Check the file /usr/lib/tztab to get starting...JP.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Will my system change time correctly?

First of all the system doesn't "change time". All UNIX boxes in the known universe simply count seconds since Jan. 1, 1970 00:00:00 UTC -- you know, the creation time of the UNIXverse. What does change is the way the time is displayed. You don't want to set the system date and especially not backwards. You will end up with database transactions so that transaction 100 happened before transaction 99. That ain't esay to explain to a customer. Moreover, utilities like make will get very confused because object files are now newer than source files. There have been a few patches related to cron but as long as your system is reasonably well-patched, you are fine and cron handles the transition just fine. Man cron for details.

You can use the attached Perl script to see if the system will correctly display/print times.

Invoke as dst.pl -u for full usage or simply dst.pl -n to display the next time change.

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

Re: Will my system change time correctly?

I should add that the dst.pl uses the same underlying functions that the date command uses, so if it works, date works.

Moreover, time changes are intimately tied to TZ settings so if you have users in multiple TZ's you should check each one by setting and exporting TZ before running dst.pl or defining it for just that command, viz:
TZ=EST5EDT dst.pl -n
TZ=CST6CDT dst.pl -n

Oh, and as a bonus, if you have one of the freely available Perls for Windows, it works on them there boxes as well.

If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: Will my system change time correctly?

Simple answer: As far as displayed time goes, YEs.

Want to make sure its always accurate?

NTP

valid time server in /etc/ntp.conf

/etc/rc.config.d/netdaemons

XNTPD=1


TZ controls display.
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
Derek Card
Advisor

Re: Will my system change time correctly?

Thanks. I downloaded A Clay's script and it worked perfectly. I feel better now.

Thanks,
Derek