Operating System - HP-UX
1845823 Members
3574 Online
110250 Solutions
New Discussion

How to set the timezone without Daylight Savings Time?

 
SOLVED
Go to solution
MA Qiang
Regular Advisor

How to set the timezone without Daylight Savings Time?

I can not find the timezone in /usr/lib/tztab for GMT without Daylight Savings Time.

Thanks!
4 REPLIES 4
Chris Watkins_1
Respected Contributor

Re: How to set the timezone without Daylight Savings Time?

Use set_parms timezone.
It has the non-daylight options.
You can also specify a custom timezone if needed.
Not without 2 backups and an Ignite image!
Jdamian
Respected Contributor

Re: How to set the timezone without Daylight Savings Time?

GMT0
MA Qiang
Regular Advisor

Re: How to set the timezone without Daylight Savings Time?

Can I use GMT?
Bill Hassell
Honored Contributor
Solution

Re: How to set the timezone without Daylight Savings Time?

HP-UX keeps time as GMT. When you login, the GMT time (more accurately known as UTC time) is translated by the setting of TZ. So you can set the TZ variable for all users by editing the file: /etc/TIMEZONE which looks like this:

TZ=EST5EDT
export TZ

Change it to read:

TZ=GMT
export TZ

and now your local time will be displayed and interpreted as GMT.

NOTE: HP-UX is somewhat unique in handling timezones. Look at the manpage for tztab (and also look at the file: /usr/lib/tztab) to see how it it can be customized. HP-UX never changes time for Dalight Saving, the system libraries only change the representation of time based on TZ. This is quite a feature because any user from anyplace in the world can see the server's time in their local timezone. The user's timestamps for file changes will match local time as well as date reporting the local time. All the user has to do is export TZ in their local .profile and presto! local time. You can demonstrate this with these commands:

date
TZ=GMT date
TZ=EST5EDT date
TZ=XYZ1 date
TZ=ABC-1 date

Now you'll notice that timezones XYZ and ABC are not defined in tztab. You can actually define your own timezone as well as any Daylight Saving you'd like to use. The details are a bit hidden: man environ


Bill Hassell, sysadmin