1833323 Members
3057 Online
110051 Solutions
New Discussion

Re: Timezone change

 
doug kirk
Advisor

Timezone change

I did a TZ=CST6CDT and an export TZ but the system time didn't change. Is there something that I am missing?
8 REPLIES 8
RAC_1
Honored Contributor

Re: Timezone change

Setting TZ never changes time, what it does changes the way time is re-presented. The system time is always in GMT.

What exactly you want?? Change time or set TZ?? you can just do export TZ=xxx, and it will take effect immediately.

For setting the time, (setting it ahead , setting it back), you will have to use date command. but do understand that applications like oracle etc are time sensitive and can crate problems.

Anil
There is no substitute to HARDWORK
Simon Hargrave
Honored Contributor

Re: Timezone change

> The system time is always in GMT.

Being pedantic, it's not GMT but UTC (which is exactly the same as GMT to all intents and purposes) ;)
doug kirk
Advisor

Re: Timezone change

I set up NTP and I am pulling time from our time server and now my system is an hour fast. I thought if I changed the timezone the system would change an hour. Any suggestions to resolve?
RAC_1
Honored Contributor

Re: Timezone change

Setting it to NTP would not help if time difference is too much. (that is also in some milli secs)

If you want to set to the time server, first shutdown all applications that are time sensitive, then do ntpdate command. This would set time same as that of NTP server. then start NTP.

Anil
There is no substitute to HARDWORK
A. Clay Stephenson
Acclaimed Contributor

Re: Timezone change

You seem to assume that your system has a single timezone; in fact, your system could have many TZ settings all in play simultaneously and all equally valid. You could have users scattered all over the planet. /etc/TIMEZONE serves as the default for TZ but is easily overriden by a new definition of TZ. You should be able to set /etc/TIMEZONE and then logout. Log back in and run the date command. Your new timezone setting should now be in effect -- for this session and assuming that your own .profile (or /etc/profile) does not override /etc/TIMEZONE. Processes that were started before the TZ change won't have a clue that anything has changed. All NTP protocols use UTC and TZ only affects how time is displayed. If you want your new timezone settings (as defined in /etc/TIMEZONE) to be recogized by all processes, including daemons, you will need to reboot. Normally, /etc/TIMEZONE never needs to be changed after the initial installation. Daylight savings time transitions are handled automatically by the system and no intervention should be required.
If it ain't broke, I can fix that.
Fred Ruffet
Honored Contributor

Re: Timezone change

HP server stores UTC time. When Coordinating with NTP, UTC time is what you get. When you want to display date, TZ is used, and date is displayed with this modifer.

Now for seeing time reflect our marvelous Daylight Saving Time system, you must have a TZ set to something ending with DST (like Daylight Saving Time). You can find possibilities in /usr/lib/tztab.

regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
doug kirk
Advisor

Re: Timezone change

NTP adjusted the UTC time but now the UTC time is an hour fast. The UTC on the time server is correct. How can I get this server in sync with the time server?
Marc Ahrendt
Super Advisor

Re: Timezone change

1st use ntpdate get the same time value from the NTP server

2nd use xntpd to keep "sync'ed" with the NTP server

3rd use whatever TZ value is appropriate for your environment ...as the pros above have explained

NOTE: since going backwards about a hour in time you may what to do steps 1 and 2 above by just rebooting ...but before rebooting make sure NTP is configured properly and that ntpdate is set to run in /sbin/init.d/xntpd
hola