1846992 Members
3039 Online
110257 Solutions
New Discussion

Re: TZ variable

 
SOLVED
Go to solution
Hunan_1
Frequent Advisor

TZ variable

Hi all,
I have some questions about TZ, if I change the default value (which is SAT5) could I get some problems?

I'm in charge of a management system running over 3 servers (communications, database and aplications) I guess the last problem we had, it was because the system has set TZ=SAT5, and yesterday it was a problem about the change of season for this time zone.

So I wanna change the TZ to GMT-5, but maybe I could have some poblems with the system if I do it.

Does anyone could explain me what are the changes that occurs in the OS when you change TZ... The server's OS are HP-UX 10.20 and 11.00

Any help would be appreciated.
10 REPLIES 10
A. Clay Stephenson
Acclaimed Contributor

Re: TZ variable

Changing the TZ setting is no big deal and it will not lead to problems but there might be things that behave differently. A single machine could have tens of different TZ settings and that is considered normal. Users might be logged in from all over the world -- each with an appropriate TZ setting. TZ does not affect how the system keeps time -- that is always number od seconds since Jan 1, 1970 00:00:00 UTC --- but TZ does affect how the time is displayed. The other effects are cron and at jobs; man crontab for those details. Dealing with time changes is a normal activity and normally UNIX boxes handle the time changes very well with no intervention.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: TZ variable

Hi:

Changing the TZ variable does not change anything other than the user or processes perception of the time. That is, the server's time doesn't change, only the value displayed.

The server's default value is kept in '/etc/TIMEZONE'. This file is sourced (read) during login by '/etc/profile' and the TZ variable exported to the user's environment.

If you wish to set and use a particular timezone only for the duration of a single process you can do so, overriding any global default. For instance:

# TZ=GMT date

...will display your server's time in UTC (GMT) time.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: TZ variable

I don't think you'll have problem changing the TZ to Greenwhich Mean Time.

Many servers that server the entire world(web) use that as a standard.

The only thing that can give you any trouble is if you actually try and roll back system time, which you are not proposing.

As A. Clay notes, you can also customize your user base based on where they connect from. Moving an International server to GMT is a good idea and should have no ill effects.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Hunan_1
Frequent Advisor

Re: TZ variable

Hi friends for your replies, now I have more clear the changes I need to do...

Just before to go, one more thing... I don't need to reboot the system to apply the changes, rigth?
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: TZ variable

The answer is that it depends. Processes that are already running will remain under the old TZ setting. Your safest option (especially for cron and at jobs) is to make the change and reboot.



If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: TZ variable

Hi (again):

Like any environmental variable, TZ will be read during process setup ('exec()') or upon an explicit export into the process's environment. Therefore, if you want all processes and users to have a consistent setting, change the global definition ('etc/TIMEZONE') and reboot.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: TZ variable

Hi (again):

Like any environmental variable, TZ will be read during process setup ('exec()') or upon an explicit export into the process's environment. Therefore, if you want all processes and users to have a consistent setting, change the global definition ('etc/TIMEZONE') and reboot.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: TZ variable

Hi (again):

Like any environmental variable, TZ will be read during process setup ('exec()') or upon an explicit export into the process's environment. Therefore, if you want all processes and users to have a consistent setting, change the global definition ('etc/TIMEZONE') and reboot.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: TZ variable

I would make the change and arrange a reboot as soon as possible. This applies to any HP-UX.

Any process fired up before the change will operate under the old TZ setup. Consequences depend on the application design.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Hunan_1
Frequent Advisor

Re: TZ variable

Thanks again Clay and James,

I'll apply your suggestions.

James It seems you're nervous... I'm who's in trouble not you :-)

(It's a joke...)