- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Automatic Dayligh Saving Setting
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
Discussions
Discussions
Forums
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
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
тАО11-17-2010 09:03 AM
тАО11-17-2010 09:03 AM
Automatic Dayligh Saving Setting
We supply a product to users all over the US, so some do not swith such as in Arizona.
We currently set up each site with a cron job on the weekend the switch is to occur and would like to see if we can utilize HP UNIX automatic switch capabilities.
- Tags:
- DST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2010 10:41 AM
тАО11-17-2010 10:41 AM
Re: Automatic Dayligh Saving Setting
HP-UX will automatically adjust from/to a Daylight Saving Time based on the value of the 'TZ" variable that relates to the rules defined in '/usr/lib/tztab'. This is documented in the manpages for 'tzab(4)' and for 'cron(1M)' [the later in the section, "Spring and Autumn Time Transitions".
As for querying the current setting, a simple shell:
# date "+%Z"
...would do. In my case this shows "EST" or Eastern *Standard* Time.
You could also use a Perl snippet (which leverage the standard libC routines):
# perl -le 'print +((localtime)[8])'
This prints "0" for standard time and "1" when/if you are in Daylight Saving time.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2010 12:13 PM
тАО11-17-2010 12:13 PM
Re: Automatic Dayligh Saving Setting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2010 12:40 PM
тАО11-17-2010 12:40 PM
Re: Automatic Dayligh Saving Setting
> Do you know if in this case if a call to tzset would set the value in the variable daylight? If so is that faster execution wise as I will be executing this from a program that essentially runs 24/7?
Your HP-UX server if setup with a TZ rule for Daylight Saving time will perform the shift which in turn will be reflected in the 'tm' structure's 'tm_isdst' field. You can obtain this in C code or in Perl as I noted using 'localtime()'. Depending on how often you call your program, a pure C implementation will probably be faster, though by what measurable amount is left to you to decide.
The overhead of creating a new process to interrogate the state of Daylight savings is certainly the larger component of the whole activity. Hence, if you are going to sample "frequently" and/or for "long" periods, you should encapsulate your sampling in a loop that sleeps; awakens; samples; and returns to sleep, thereby avoiding process instantiation each time.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2010 01:07 PM
тАО11-17-2010 01:07 PM
Re: Automatic Dayligh Saving Setting
Again, thanks for the help.
Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2010 02:33 PM
тАО11-17-2010 02:33 PM
Re: Automatic Dayligh Saving Setting
Welcome to the ITRC forums. If you have found the answers you received helpful, please read :
http://forums11.itrc.hp.com/service/forums/helptips.do?#28
Regards, and good luck.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-18-2010 12:11 AM
тАО11-18-2010 12:11 AM
Re: Automatic Dayligh Saving Setting
Of course it won't. tzset(3) says:
The external variable daylight is non-zero only if a summer time zone adjustment is specified in the TZ environment variable.
This means the timeszone has adjustments but not when.
>If so is that faster execution wise
If you sleep every hour, it really doesn't matter how much time you take. You can also do a binary search to find the exact time and sleep the N days until then.
>JRF: Depending on how often you call your program, a pure C implementation will probably be faster, though by what measurable amount is left to you to decide.
Probably not by much.
>The overhead of creating a new process to interrogate the state of Daylight savings is certainly the larger component of the whole activity.
Right.
>I generally dislike checking some status over and over again.
That's where the modified binary search may help. Or Clay's dst.pl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-18-2010 10:55 AM
тАО11-18-2010 10:55 AM
Re: Automatic Dayligh Saving Setting
Realistically, the overhead should be so low that a simple while loop that sleeps most of the time should be quite sufficient.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-18-2010 12:16 PM
тАО11-18-2010 12:16 PM
Re: Automatic Dayligh Saving Setting
Thanks for all the help
Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-19-2010 04:42 AM
тАО11-19-2010 04:42 AM
Re: Automatic Dayligh Saving Setting
You don't mark them with the timezone? Or that's the problem?
Or always stamp them with UTC?