- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to setup timezone with NO clock changes
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
тАО04-25-2011 02:13 PM - last edited on тАО08-17-2011 08:37 AM by Kevin_Paul
тАО04-25-2011 02:13 PM - last edited on тАО08-17-2011 08:37 AM by Kevin_Paul
Egypt has decided not to change the clock at all, at least for the time being. So, no DST. I am trying to understand what is the best way to do this. The system is running HP-UX 11i v3. They currently have the following custom entries in /usr/lib/tztab.
#Custom Time zone CAT-2CATDT for Cairo - NK018559
CAT-2CATDT
0 1 24 4 2009 0-6 CATDT-3
0 23 20 8 2009 0-6 CAT-2
0 1 24 4 2010 0-6 CATDT-3
0 23 20 8 2010 0-6 CAT-2
Clearly changing the last two entries is one option. I would just change the last two lines as follows.
0 1 24 4 2010-2038 0-6 CAT-2
0 23 20 8 2010-2038 0-6 CAT-2
In discussions with other associates at my company, it has been suggested that it would be better to create a new timezone. I must say I do not fully understand why others have suggested that option, but I wanted to solicit input from this group about it.
I got some good info from the following thread already, but it does bring one question to mind. The timezone is in /etc/TIMEZONE and /etc/default/tz. Is it only necessary to change /etc/TIMEZONE?
http://h30499.www3.hp.com/t5/System-Administration/HP-UX-time-setting/m-p/4774412#M390323
So - what if I wanted to set up a new timezone that never changes? I do not know if there is a predefined timezone for Cairo - I did not see one in /usr/lib/tztab. Assuming there is nothing suitable, what is the proper way to create a new timezone? If it never changes does that mean there does not need to be anything in /usr/lib/tztab?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2011 01:21 AM
тАО04-26-2011 01:21 AM
SolutionProbably a new timezone.
>I would just change the last two lines as follows.
0 1 24 4 2010-2038 0-6 CAT-2
0 23 20 8 2010-2038 0-6 CAT-2
You can't do this because you would change an existing 2010. You would need to add two lines for 2011 and on.
Or perhaps you don't have an entry for 2011?
>what if I wanted to set up a new timezone that never changes?
Easy: TZ=CAT-2
>what is the proper way to create a new timezone? If it never changes does that mean there does not need to be anything in /usr/lib/tztab?
Just export TZ in a .profile or edit /etc/TIMEZONE and /etc/default/tz.
Right, you don't need a tztab(4) entry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2011 02:58 AM
тАО04-26-2011 02:58 AM
Re: How to setup timezone with NO clock changes
"Creating a new timezone" sounds a bit like a Windowsism. On Windows, the timezone information is stored in a rather opaque way, so you cannot even verify any future DST transitions without . As a result, creating a new timezone with an unique name makes it easier to later confirm that the correct configuration change is in fact applied - on Windows.
(See http://support.microsoft.com/kb/914387 if you're curious.)
On HP-UX, all the timezone information is in /usr/lib/tztab whose format is documented and human-readable without any conversion. It's not too difficult to check the value of the TZ environment variable and then read the appropriate /usr/lib/tztab entry: once you've done that, you will know the times of any past and future DST transitions with 100% certainty.
Remember that on Unix, all the system timestamps are internally stored in UTC-equivalent form, and converted to your local time (using the currently-configured timezone settings) on output. So, if you change your timezone setting to "CAT-2", the system will assume that there is no DST _and never has been_, so e.g. the timestamps of files last modified on June 2010 will seem to be 1 hour off when viewed with "ll". The timestamps will still contain the correct information in UTC timezone, but with the "CAT-2" setting, the conversion to local time will stop taking into account that DST _was_ used in 2010.
If you don't care about the accuracy of old timestamps, you can certainly change the timezone setting to "CAT-2". If you do so, this TZ setting will contain all the information the system needs for basic local time support: the timezone name "CAT" and the UTC offset "-2". If there is no DST timezone suffix, then the /usr/lib/tztab file will not be used at all.
If you choose to make any changes, you should change both /etc/TIMEZONE and /etc/default/tz.
Historically, HP-UX used to have timezone settings as kernel parameters "timezone" and "dst": this was deprecated long ago, and is currently used mainly by some legacy PA-RISC applications. HP-UX 11iv3 still has these kernel parameters, but they might finally go away in 11iv4 as the PA-RISC support ends.
/etc/TIMEZONE used to be the "current" way to configure the timezone in the previous 10.20...11.xx releases.
/etc/default/tz was introduced in some 11i release (maybe 11iv2, I think?), so in the future this will perhaps be the "primary" way to set the timezone.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2011 06:37 AM
тАО04-26-2011 06:37 AM
Re: How to setup timezone with NO clock changes
Forgive my mistake - I'm usually pretty good about remembering the new year when it changes, but for some reason I was thinking the current /usr/lib/tztab had entries for the current year, 2011, when I was thinking about modifying the 2010 entries. That is not what I meant to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2011 07:22 AM
тАО04-26-2011 07:22 AM
Re: How to setup timezone with NO clock changes
It looks like all I need to do is set it up in /etc/default/tz and /etc/TIMEZONE. I just ran a test where I put the string "EGT-2" in these files and rebooted. I did not put anything in /usr/lib/tztab.
Does this sound correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2011 08:23 AM
тАО04-26-2011 08:23 AM
Re: How to setup timezone with NO clock changes
>Does this sound correct?
Sounds fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2011 08:30 AM
тАО04-26-2011 08:30 AM
Re: How to setup timezone with NO clock changes
Note: You can have multiple timezones on the system. One for operations and even one for specific users of that application.
Just "export TZ" in the appropriate .profile.
In this case you don't have to reboot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2011 08:37 AM
тАО04-26-2011 08:37 AM
Re: How to setup timezone with NO clock changes
YIKES - I don't think I would want to do that unless it was simply for testing something. Sounds very dangerous as a way to do things.
I am recommending a reboot to make certain that all applications use the new timezone.
Thanks again for the help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2011 10:47 AM
тАО04-26-2011 10:47 AM
Re: How to setup timezone with NO clock changes
> YIKES - I don't think I would want to do that unless it was simply for testing something. Sounds very dangerous as a way to do things.
That's absolutely not true. Unix (and NTP) work in UTC. The concept of a timezone is simply the +- offset in which *you* like to measure time.
The underlying clock ticks away in ever-advancing seconds (oh, yes, for the most part) -- one second since January 1, 1970 at 00:00:00 UTC.
Your perception of that Epoch may be slightly earlier or slightly later in your localtime, but the fundamental value remains the same.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2011 11:07 AM
тАО04-26-2011 11:07 AM
Re: How to setup timezone with NO clock changes
It is what I would call "slick" but not easily maintainable, hence in my opinion NOT a good practice. Not all time is recorded in UTC in the applications, so it is less relevant what is going on at the OS level.
So, we must agree to disagree!