Operating System - HP-UX
1825777 Members
2174 Online
109687 Solutions
New Discussion

Changing timezones on the fly

 
SOLVED
Go to solution
Joe Profaizer
Super Advisor

Changing timezones on the fly

Can I change the time of a system from CST to EST? I could change the time to match the correct eastern time, but I also need to change it to eastern standard time. If so, will this require a reboot?
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Changing timezones on the fly

At one level your question has no meaning because a system could literally have used logged in all over the world -- each with a unique TZ value. Changing the value in /etc/TIMEZONE will affect any processes that use the default TZ value that are started after the change but will not affect those that are currently running. If you want all the daemons (e.g. cron) to recognize the change then you really should reboot. Obvoiusly, you could stop and restart the daemons (again, e.g. cron) but it would be very easy to miss one.
If it ain't broke, I can fix that.
HGN
Honored Contributor

Re: Changing timezones on the fly

Hi

A timezone change requires a reboot,but the indivijual user can set the TZ on the profile but that will be in effect only for that particular user.

Rgds

HGN
James R. Ferguson
Acclaimed Contributor

Re: Changing timezones on the fly

Hi Joe:

You have several options.

If you want to change the timezone for the duration of one command, do:

# TZ=EST date

That is, set the TZ value; type a blank (space) and your command or script.

If you want to change it for a user, you can set it in the user's profile.

If you want to change it system-side, change it in ' /etc/TIMEZONE. This file is sourced by '/etc/profile' so new logins would see the change.

If you change the timezone system-wide, you should at least restart 'cron' (/sbin/init.d/cron stop|start).

If you want a permanent, consistent change, modify '/etc/TIMEZONE' and reboot. In that way all processes will inherit a consistent view of local time.

Regards!

...JRF...