Operating System - HP-UX
1848906 Members
6385 Online
104038 Solutions
New Discussion

Re: Reg. TIme Zone Changing

 
Kennedy_1
Occasional Contributor

Reg. TIme Zone Changing

Hi I need to change the time zone for various places in one of our unix server for an application testing.

How do I make changes to effect daylight saving for the time zones which have daylight saving(For ex. US-Pacific has day light saving whereas Arizona does not have daylight saving)
6 REPLIES 6
Ajitkumar Rane
Trusted Contributor

Re: Reg. TIme Zone Changing

Hi
You can run set_parms timezone and it will show you the different TZ's. basically it should open up a GUI and you can select PDT for pacific daylight savings time the other option for pacific time will be PST pacific std time. etc depending upon your time zones.

Goodluck
Amidsts difficulties lie opportunities
Shahul
Esteemed Contributor

Re: Reg. TIme Zone Changing


Hi

U login as root and then run this command

#set_parms timezone

Now it will list 1-7 locations, U will have to select the proper one. Then it will list the countries in that location. U will have to select the proper country. Then it will show the current time. Now verify that.

Bettr U close mager processes like ur oracle or other application softwares before running this command, because those applications may be dependend on time.


Shahul
JAYAMOHAN.V.D
Occasional Advisor

Re: Reg. TIme Zone Changing

hi,
u can also use the command "setup" to set the time zone. u should be the root user to use this command
This gives u 5 options. the second option is to change the time zone. its a menu based program.
it will be better to use this command in the single user mode.
regards
jayamohan.v.d
Ajitkumar Rane
Trusted Contributor

Re: Reg. TIme Zone Changing

Hello
Adittion to my reply, You need to reboot the server to see the changes with he date command.
the set-params will update the /etc/TIMEZONE.

goodluck
Amidsts difficulties lie opportunities
A. Clay Stephenson
Acclaimed Contributor

Re: Reg. TIme Zone Changing

Hi:

Actually, there is a better way, simply set and export the TZ variable manually. Remember,
TZ does not alter the way system timestamps are stored only how they are displayed. Consider two users, one set with TZ=CST6CDT and the other set with TZ=PST8PDT. If each user lools at a file timestamp or the system time (via date) they will get two different values eventhough the system simply counts the number of seconds since Jan 1, 1790 00:00:00 UTC. There is a real advantage to manually setting and exporting TZ, you can set really weird timezones than only shift by 30 minutes for daylight savings times or on really strange days of the year. That way, you can give your application a much better test than simply using the defined values.
You should man environ for a really good explanation of setting the TZ value.

Regards, Clay
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: Reg. TIme Zone Changing

HP-UX keeps only on time of day: UTC also known as Universal Coordinated Time, Zulu time or Greenwich Mean Time. The value for TZ will change the way this time is displayed or updated. This is unlike other operating systems which have a single time.

The recommendation to use set_parms should not be used for testing, only for physical transport of the computer to another timezone. Instead, use the value for TZ to control the environment for the programs. HP-UX can be accessed anywhere in the world in any timezone and display time information as local time by using TZ. See the man page for tztab. Note that tztab (and TZ) can handle any rules (including Indiana which is quite strange). Arizona (MST) is already coded in tztab, but should a local legislature decide to change the rules, a simple edit of txtab will fix everything.


Bill Hassell, sysadmin