1847797 Members
3650 Online
104021 Solutions
New Discussion

Re: set_parms timezone

 
Christopher Davis
Occasional Contributor

set_parms timezone

I have three HP-UX machines running B.11.00, and I would like to keep the time zone set at EST (i.e. not change to EDT as they do now). Can this be done using the set_parms timezone command, and if so, what syntax would I need to make this happen? Also, assuming that I do this as root, will I need to reboot the machines in order to make the changes take place immediately and remain in effect "forever"? Currently, the the TZ parameter is set to EST5EDT.
Success comes in "cans" not "cannots"
7 REPLIES 7
Caesar_3
Esteemed Contributor

Re: set_parms timezone

Hello!

If your TZ is ok (the wanted timezone)
then you don't need to use the set_parms
On the system there is file /usr/lib/tztab
that set the timezone switch
there find block of the value of TZ
and see that you had no lines that will change the timezone.

Read man about tztab and how to edit it.

Caesar
A. Clay Stephenson
Acclaimed Contributor

Re: set_parms timezone

All you need to do is modify /etc/TIMEZONE to
TZ=EST5
export TZ

and reboot.

NOTE: This will NOT change all date displays because any user/process can set a custom TZ and override the default setting. In fact, it is perfectly normal to have many TZ settings on the box. TZ only determines how a time is DISPLAYED; all UNIX boxes in the known universe simply count seconds since 00:00 Jan 1, 1970 UTC.

You are probably concerned about crontab entries; they are handled unambiguously as well.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: set_parms timezone

Hi:

Edit '/etc/TIMEZONE' and specify "TZ=EST5". A reboot is not necessary, although any procesees already using the old value will not use the new one until they are restarted.

Regards!

...JRF...
Christopher Davis
Occasional Contributor

Re: set_parms timezone

Many thanks for this information. I went to the /usr/lib/tztab file and found an entry for EST5EST - which would seem to me to be what I was looking for. That being the case, should I use the set_parms timezone command to set a new value for the TZ parameter, to EST5EST?
Success comes in "cans" not "cannots"
A. Clay Stephenson
Acclaimed Contributor

Re: set_parms timezone

No, you want no daylight time so the appriopriate change is simply TZ=EST5. Man 5 environ and look for TZ for details.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: set_parms timezone

By the way, since you mentioned 3 servers -- it is a very good idea to implement NTP so that these boxes can be kept "in sync"; in general, computers are lousy clocks but NTP will allow them to sync within at most milliseconds of each other. You can set NTP up using sam. Look in /usr/share/doc/NTP_Primer.txt for a very good treatment of the subject.
If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: set_parms timezone

You can do this by just editing your timezone so that it is just EST instead of EST5EDT.

The time on the machine DOES NOT EVER change, the way it is displayed changes based on YOUR TZ setting.