- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Day light saving time
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
03-20-2006 09:46 AM
03-20-2006 09:46 AM
Can someone tell me if there is a quick check that can be run on a system to see when the daylight savings time is going to kick in? Wanted to check this out considering daylight savings (in NSW, AUSTRALIA) is going to be a week later than usual due to a recent government ruling for the commonwealth games over here.
thanks heaps
maria
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 09:52 AM
03-20-2006 09:52 AM
SolutionYou can invoke it as dst.pl -u for full usage but simply "dst.pl" will display the exact second before and after the time transition. You can check multiple TZ's by:
TZ=CST6CDT dst.pl
TZ=MST7MDT dst.pl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 09:54 AM
03-20-2006 09:54 AM
Re: Day light saving time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 10:52 AM
03-20-2006 10:52 AM
Re: Day light saving time
In most normal time zones, if the Timezone is set, the time will change on schedule.
If your change is very recent, you may want to make sure you are up to date. There is a file you can use to override time zone changes. We have to use it to deal with the Knesset here not being able to agree year to year on the time switches.
Also, though its really slight of hand, if you are connected to an ntp server, you have nothing to worry about.
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
03-20-2006 11:18 AM
03-20-2006 11:18 AM
Re: Day light saving time
Steven, what is the name of the file. I believe this is a quite recent change, that is why I am checking.
thanks again
Maria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 11:44 AM
03-20-2006 11:44 AM
Re: Day light saving time
HP-UX uses a variable called TZ to define how to interpret UTC for a local user. The first place to start with timezones is the man page for environ (man environ). You'll see that you can use my own personal tiomezone called BILLH5:33:12 by doing something like this:
TZ=BILLH5:33:12 date
You'll see the time is displayed 5 hours, 33 mins and 12 seconds to the west of GMT and there is no Daylight Saving for summer. Of course, this is only an academic example, but shows that you can define any rule for a local timezone. Just set TZ as required.
The US (like Australia) is changing Daylight Saving rules (remember the part about politics?) so a patch for tztab has been released but since adding your own timezone rules is just a matter of editing tztab, just use the man pages for tztab and environ.
As far as Perl goes, you should have it already installed on your system. Check the version with perl -v (you need 5.xxxx to be current). Note that once you change tztab, the results are immediate. Although tricky to find (man date), if TZ is not set, you get this:
"If TZ is not set or is set to the empty string, its default value is EST5EDT."
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 12:01 PM
03-20-2006 12:01 PM
Re: Day light saving time
/usr/lib/tztab. Unlike other flavors of UNIX, HP-UX is unuque in that the time changes are managed by this textfile. You can do the changes yourself OR you can install the newly released patch, PHCO_34342, that will make the changes for you. The Perl install is very straightforward and should really be a part of any UNIX box these days. You can swinstall it from any of the Application CD sets or from: http://hpux.cs.utah.edu/hppd/hpux/Languages/perl-5.8.7/
One of the best features of Perl is that it is much more platform independent that most scripting languages. In fact, if you install one of the free Perls (e.g. www.activestate.com) on your Windowes box that same Perl script will tell you about your PC timechanges as well -- without modification. However, Windows is going to take more than a text editor to make it recognize the new time changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 12:04 PM
03-20-2006 12:04 PM
Re: Day light saving time
You should have Perl installed already as a part of a standard 11i release. You can verify with:
# swlist | grep -i perl
# whereis perl
You will probably find a Perl version installed in '/opt/perl'. Ideally, You should have some version of 5.8 as shown when you do:
# perl -v
You may find a very old version of Perl in '/usr/contrib/bin'. Ignore this one.
If you need a current version of Perl installed, you can download a set of binaries for HP-UX and install them with the standard 'swinstall' from here:
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=PERL
In HP-UX, the rules for timezones are found in '/usr/lib/tztab'. Have a look at the manpages for 'tztab(4)' for the manner in which the table should be interpreted.
http://www.docs.hp.com/en/B2355-60127/tztab.4.html
Look too, at the 'cron(1M)' manpages for information on how 'cron' interprets the TZ environmental variable:
http://www.docs.hp.com/en/B2355-60127/cron.1M.html
Variables, as for instance 'TZ' can be set for the duration of a commandline only by declaring the variable and its value followed by whitespace (blanks, tabs) and the command:
# TZ=EST5EDT date
# TZ=GMT date
Very recently, patches for the standard 'tztab' have been released with daylight saving changes for the United States and Australia.
For 11.0, use: PHCO_34266
For 11.11 use: PHCO_34342
For 11.23 use: PHCO_34375
Should you have any systems running 10.20, you can simply replace its '/usr/lib/tztab' with one of the above, since there are no official patches released for that out-of-support release.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 12:08 PM
03-20-2006 12:08 PM
Re: Day light saving time
Maria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 12:21 PM
03-20-2006 12:21 PM
Re: Day light saving time
One more thing. Once the modification has been made to the '/usr/lib/tztab' any new process started will fall under the new "rules". A restart of 'cron' would cover cron tasks. New logins would execute 'login()' so the processes spawned by those would also abide by the new time changes. A reboot of the server sometime before the mandated time change would then align everything --- things that are running and things that are later scheduled to run.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 12:30 PM
03-20-2006 12:30 PM
Re: Day light saving time
# whereis perl
perl: /usr/contrib/bin/perl /opt/perl/bin/perl /opt/perl/man/man1/perl.1
# swlist | grep -i perl
perl B.5.6.1.F Perl Programming Language.
If I try to run Clay's script, this results:
charon> # ./dst.pl
interpreter "/usr/bin/perl" not found
sh: ./dst.pl: not found.
charon> # dst.pl
sh: dst.pl: not found.
charon> #
(I am in the directory where I have Clay's script)
On looking at the script I can see the 1st line is stating a perl shell. I know I dont have that on our system. So, does this look like perl has not been configured on our system? I know this is really basic, apologies.
Maria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 12:44 PM
03-20-2006 12:44 PM
Re: Day light saving time
ln -s /opt/perl5/bin/perl /usr/bin/perl ---
this is normally a good thing to do because /usr/bin should be in everyone's PATH.
whem you install my Perl script make sure that you do a "chmod 755 dst.pl" so that the execute bit is set. When you do these two things then the script will execute as simply "dst.pl".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 12:47 PM
03-20-2006 12:47 PM
Re: Day light saving time
1) Link /opt/perl/bin/perl to /usr/bin/perl
# ln -s /opt/perl/bin/perl /usr/bin/perl
2) Replace the #!/usr/bin/perl line in Clay's script with #!/opt/perl/bin/perl
Either should allow you to run the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 01:28 PM
03-20-2006 01:28 PM
Re: Day light saving time
I have been able to run the dst.pl script, although I did have to put the ./ in front.
The output from the job was as follows:
charon> # ./dst.pl
Sun Mar 26 02:59:59 EDT 2006 --> Sun Mar 26 02:00:00 EST 2006
Sun Oct 29 01:59:59 EST 2006 --> Sun Oct 29 03:00:00 EDT 2006
Looks as though this system set to change time at 2:59am back to 2:00am on Mar 26th. Reading it right?? (amazing!)
I am thinking now that I would load up patch PHCO_34342 and then rerun this script, hopefully this would then have the correct date.
Thank you so much every one. You are some of the best!!
Maria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 02:14 PM
03-20-2006 02:14 PM
Re: Day light saving time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 03:03 PM
03-20-2006 03:03 PM
Re: Day light saving time
Maria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2006 03:46 PM
03-20-2006 03:46 PM
Re: Day light saving time
Maria