1833738 Members
2497 Online
110063 Solutions
New Discussion

timezone

 
SOLVED
Go to solution
jim bidebo
Regular Advisor

timezone

how do you change the timezone in hp-ux 11 ?
6 REPLIES 6
Bill McNAMARA_1
Honored Contributor

Re: timezone

use set_parms timezone
It works for me (tm)
Santosh Nair_1
Honored Contributor
Solution

Re: timezone

Put the correct timezone in /etc/TIMEZONE. But since you're more than likely going to need to reboot the machine in order for all the processes to recognize the new timezone, you're probably better off using Bill's suggestion above.

-Santosh
Life is what's happening while you're busy making other plans
harry d brown jr
Honored Contributor

Re: timezone

System timezone or "user" timezone?
Live Free or Die
James R. Ferguson
Acclaimed Contributor

Re: timezone

Hi Jim:

Bill is correct, you can use 'sbin/set_parms timezone' to establish the timezone.

/etc/TIMEZONE holds your global setting and this file is sourced by /etc/profile during login.

If you merely want to temporarily change your TZ variable for testing, you could set it for one command like this:

# date # ...my current TZ
# TZ=MSG7MDT date #...Mountain time for this one
# date #...my current TZ again (still)

For a list of defined timezones, see: /usr/lib/tztab

Regards!

...JRF...
jim bidebo
Regular Advisor

Re: timezone

problem solved
tnx everyone.

/etc/TIMEZONE.. and no need for reboot..

unfortunally the time changed aswell..
simple to fix anyway =)
Bill Hassell
Honored Contributor

Re: timezone

It's important to note that time NEVER changes in HP-UX, only the decoding of the time (via $TZ). HP-UX always keeps time as Zulu, Greenwich Meant Time, Universal Coordinated Time, etc, in other words, astronomer's time.

HP-UX is unique in that $TZ may be specified on a login-by-login basis such that users all over the world can login to the system, set their $TZ value to match their local timezone and all date operations such as ls -l will look correct. The set_parms timezone and /etc/TIMEZONE file are used to establish the machine's local time and provide a default TZ for logins. But as demonstrated in previous answers, just changing TZ to a different value will change the decoding of internal time.

This also includes setting the date from root. And changing the date or time is a fairly disruptive action for any server, so much so that sysadmins will often 'wrapper' the date command to not allow changing the date/time by root without a lot of warnings. It is a good idea to change date/time in single user mode then reboot. Or better yet, use NTP (part of 10.x and higher) to point to a firewall router that has NTP enabled.

Note for Daylight Savings:
--------------------------

You don't need to do anything. Zulu time has no Daylight Savings concept but the decoder file /usr/lib/tztab will take care of the time change by representing the time according to the rules in tztab. So at the fall-back hour, $TZ will cause time to appear to move backwards but in reality, only the display of the time changed. cron jobs will still run correctly although the rules are complex (man cron).


Bill Hassell, sysadmin