Operating System - HP-UX
1757513 Members
2793 Online
108862 Solutions
New Discussion юеВ

Setting Time Zone on a server

 
SOLVED
Go to solution

Setting Time Zone on a server

Hi all,

How can I set the time zone on a server?
Is it shell specific setting or system-wide parameter?
Will a process automatically detect the change in time zone at runtime without restarting the process? (Esp. Java)

Any help in this regard is highly appreciated.

Thanks,
Raghu.
Unix is not for those who donot love Unix!
6 REPLIES 6
Pete Randall
Outstanding Contributor
Solution

Re: Setting Time Zone on a server

Use /sbin/set_parms timezone.

Pete

Pete
Rita C Workman
Honored Contributor

Re: Setting Time Zone on a server

I have always used the 'set_parms' command to set this and certain other system values.

I also recommend after you change this that you reboot the system. I had to correct a timezone once, didn't reboot, and found out that cron didn't read the change until the reboot.

Just a thought,
Rita
John Palmer
Honored Contributor

Re: Setting Time Zone on a server

Processes use the TZ environment variable in order to convert to local time (see man timezone).

TZ is sourced from /etc/TIMEZONE so to make a permanent change, you have to edit that file or run setparms to do it for you.

Processes that are already running will not detect the change. To ensure that all processes are updated, you'd have to reboot. Specific processes would have to be restarted wi th a modified TZ.

Regards,
John
Trond Haugen
Honored Contributor

Re: Setting Time Zone on a server

1. /etc/set_parms timezone
2. System wide (but only after a reboot). You can set/change TZ in a shell.
3. No. The command above will change the TIMEZONE in /etc/TZ which is read as processes start. So in order to set the timezone the system needs to be rebooted.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Mahima Kaushik_2
Frequent Advisor

Re: Setting Time Zone on a server

You can set time using SAM.

Enter SAM on prompt.
Click on TIME icon.

I hope it helps.
Mahima
Aim high!

Re: Setting Time Zone on a server

Hey folks,
Thanks very much for the help.
Now, my doubt is resolved.

bye,
Raghu.
Unix is not for those who donot love Unix!