- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Time change utility?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 12:21 PM
09-10-2003 12:21 PM
I know that we in the U.S. change back to Standard Time on October 26th but does anyone know of a utility that will automatically determine when the time changes?
I've thought about doing something with the tztab file but before I start I would like to know if someone already has something that will work.
Thanks,
John Wolfe
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 12:25 PM
09-10-2003 12:25 PM
Re: Time change utility?
You can also enable ntp to keep time exactly from your timezone.
/etc/ntp.conf
You can find a list of time servers at http://www.ntp.org
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 12:28 PM
09-10-2003 12:28 PM
Re: Time change utility?
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x2d195fe8b250d71190080090279cd0f9,00.html
The downside to doing something with tztab is that it's an HP thing and not all flavors of UNIX have it. I vaguely remember doing something 4 or 5 years ago (in Perl, I think) that might be close. I'll see if I can hunt it up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 12:31 PM
09-10-2003 12:31 PM
Re: Time change utility?
The system knows, via the /usr/lib/tztab file, when to display the time differently. There really isn't anything you need to worry about on your system as far as the time change goes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 12:33 PM
09-10-2003 12:33 PM
Re: Time change utility?
Thanks,
John Wolfe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 12:42 PM
09-10-2003 12:42 PM
Re: Time change utility?
Patrick: I know that the system will handle the time changes automatically. This is needed for user notification.
Thanks,
John Wolfe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 12:51 PM
09-10-2003 12:51 PM
Re: Time change utility?
Shells are dependent on the TZ variable & if it's a set with a ?STX?DT like CST6CDT then it knows about the time change.
For anything else (daemons?) that don't have $TZ, then kernel parameters timezone & dst take care of this.
But if you want to figure the day of the month then /usr/lib/tztab file ought to give you all you need to pass to Clay's date hammer (caljd.sh or caljd.pl) to tell you what day of month it would be. You should just have to pass it the year, month, & day of month range.
So for this year you pass it 2003, October & 25-31 using the proper parms (sorry I don't know them off the top of my head) & it will give you the day. Then the hour (3) & minute (0) are fixed.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 12:56 PM
09-10-2003 12:56 PM
Re: Time change utility?
But I see that Clay doesn't think it can do this. I'm crestfallen - the MIGHTY data hammer cannot do this? Tell me it ain't so!
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 01:07 PM
09-10-2003 01:07 PM
SolutionI found it. It's called dst.pl. I found that I made a small change in 2001 so that Windows could use it as well (if you have one one the free Perls for Windows -- www.activeperl.com).
Invoke as dst.pl -u for usage but here are a few examples.
dst.pl
will display the time changes for the current year and current TZ.
TZ=EST5EDT dst.pl -y 2004
will display the time changes for 2004 in Eastern (US) time.
If using a TZ that does not change (e.g. GMT0) then nothing is printed and a non-zero result is returned.
You can change the output format to something more to your liking but this should be very close. Note: It does use tztab but not directly. Perl relies upon the underlying ctime() and strftime() functions so if they use tztab (again, not all UNIX's have it), this script implicitly uses it. That is why it will even work on Windows what don't know nothing about no /usr/lib/tztab.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 01:11 PM
09-10-2003 01:11 PM
Re: Time change utility?
You may need to change the "shbang" to point to something other than /usr/bin/perl.
e.g.
#!/opt/perl/bin -w
although I always soft link whatever is the "real" Perl executable to /usr/bin/perl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 01:33 PM
09-10-2003 01:33 PM
Re: Time change utility?
In looking over the code, I discovered a small (and harmless but embarassing booboo). The -y year parameter should really have subtracted 1900 since the time functions expect years since 1900 but because of the kindness of the libc routines, 2004 (instead of 104) worked. It worked fine under HP-UX and Windows but there might be a problem under other versions. This new versions corrects that possible error.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 01:47 PM
09-10-2003 01:47 PM
Re: Time change utility?
A. Clay's script worked great. I'll download his new version but the old version seemed perfect to me.
It actually displays this:
Sun Apr 06 01:59:59 PDT 2003 --> Sun Apr 06 03:00:00 PST 2003
Sun Oct 26 01:59:59 PST 2003 --> Sun Oct 26 01:00:00 PDT 2003
Thanks for all your help.
Regards,
John Wolfe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 02:02 PM
09-10-2003 02:02 PM
Re: Time change utility?
I'm glad you were able to use the script but there seems to be a problem in your output:
Sun Apr 06 01:59:59 PDT 2003 --> Sun Apr 06 03:00:00 PST 2003
Sun Oct 26 01:59:59 PST 2003 --> Sun Oct 26 01:00:00 PDT 2003
***** SHOULD BE *****
Sun Apr 06 01:59:59 PST 2003 --> Sun Apr 06 03:00:00 PDT 2003
Sun Oct 26 01:59:59 PDT 2003 --> Sun Oct 26 01:00:00 PST 2003
Was this a typo that reversed the PST/PDT's or did you possibly have an incorrect TZ setting PDT8PST rather than the correct PST8PDT or (horrors) do I have a bug?
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 02:12 PM
09-10-2003 02:12 PM
Re: Time change utility?
The problem was my bad typing. The display was correct. I should have copied and pasted the display but I typed it in instead. The script is fine.
Regards and thanks,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2003 06:35 PM
09-10-2003 06:35 PM
Re: Time change utility?
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 08:50 AM
09-11-2003 08:50 AM
Re: Time change utility?
I have just finished a script which automatically emails my users and displays the time change data with a notice that all normally scheduled jobs will continue to function without change. I combined A. Clay's earlier answer with his dst.pl script to get just the right approach.
I continue to be amazed at the level of knowledge to be found in the Forums. Often, I can better and faster answers here than from our paid support contracts.
Thanks to everyone who responded.
Regards,
John Wolfe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2003 08:59 AM
10-24-2003 08:59 AM
Re: Time change utility?
I hope you think the same !
Give it a try !
Best Regards,
Paulo Marques