System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

TZTAB Modified TIME ZONE Not Correct

 
Regina Mitchell
Frequent Advisor

TZTAB Modified TIME ZONE Not Correct

I have two servers running HPUX 11.11 Server A shows correct time and correct timezone as CST. Server B has correct time but incorrect timezone as CDT.

I need SERVER B to match Server A. Looks like somone edited /usr/lib/tztab on SERVER B. I know we can repatch the tztab but since it was manual modified it will take some manual intervention. I was wondering if I copied the tztab file from the good server A to server B and eboot server B, could this resolve my issue?

All replies are appreciated.

14 REPLIES
Viveki
Trusted Contributor

Re: TZTAB Modified TIME ZONE Not Correct

Yes, you can achieve it by copying from the good server.
Pete Randall
Outstanding Contributor

Re: TZTAB Modified TIME ZONE Not Correct

What is your TZ variable set to on the two servers. It's the TZ that controls what is displayed and how it's displayed.


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: TZTAB Modified TIME ZONE Not Correct

Hi Regina:

One wonders if Server-A has the WRONG localtime. In US Central Time prior to 2007, it would now be standard and not daylight time at this writing. Using the 2007+ rules means that it's not until this weekend that we transition to standard time.

I would 'diff' the '/usr/lib/tztab' of both servers in question to evaluate correctness.

I would also verify the UTC time on both servers with:

# date -u

...and make sure that is indeed correct.

Regards!

...JRF...
Regina Mitchell
Frequent Advisor

Re: TZTAB Modified TIME ZONE Not Correct

Here is what TZ and tztab has for both servers.

SERVER A:
# more /etc/TIMEZONE
TZ=CST6CDT
export TZ
______________________________
# Central Standard Time, Central Daylight Time
CST6CDT
0 3 24-30 4 1970-1973 0 CDT5
0 3 6 1 1974 0-6 CDT5
0 3 22-28 2 1975 0 CDT5
0 3 24-30 4 1976-1986 0 CDT5
0 3 1-7 4 1987-2038 0 CDT5
0 1 25-31 10 1970-1973 0 CST6
0 1 24-30 11 1974 0 CST6
0 1 25-31 10 1975-2038 0 CST6


SERVER B:
# more /etc/TIMEZONE
TZ=CST6CDT
export TZ
TIMEZONE: END
________________________________________
# Central Standard Time, Central Daylight Time
CST6CDT
0 3 24-30 4 1970-1973 0 CDT5
0 3 6 1 1974 0-6 CDT5
0 3 22-28 2 1975 0 CDT5
0 3 24-30 4 1976-1986 0 CDT5
0 3 1-7 4 1987-2006 0 CDT5
0 3 8-14 3 2007-2038 0 CDT5
0 1 25-31 10 1970-1973 0 CST6
0 1 24-30 11 1974 0 CST6
0 1 25-31 10 1975-2006 0 CST6
0 1 1-7 11 2007-2038 0 CST6
Regina Mitchell
Frequent Advisor

Re: TZTAB Modified TIME ZONE Not Correct

date -u shows server B 1 hour behind server A
Regina Mitchell
Frequent Advisor

Re: TZTAB Modified TIME ZONE Not Correct

So do you think I can copy tztab from Server A the ccorrect server to Server B the incorrect server and reboot the server will correct server B?
James R. Ferguson
Acclaimed Contributor

Re: TZTAB Modified TIME ZONE Not Correct

Hi (again):

Yes, just as I thought: Server-A has an old, erroneous '/usr/lib/tztab'. Server-A "thinks" it is now standard time when it really isn't.

Look at the last line of the stanza:

0 1 25-31 10 1975-2038 0 CST6

Now look at how this is interpreted:

http://docs.hp.com/en/B2355-60127/tztab.4.html

You need to update Server-A. See:

http://www.itrc.hp.com/service/patch/patchDetail.do?patchid=PHCO_39172

_AND_READ_ the SPECIAL INSTALLATION INSTRUCTIONS.

Regards!

...JRF...
Regina Mitchell
Frequent Advisor

Re: TZTAB Modified TIME ZONE Not Correct

Hi James,

So from what you are saying Server A and Server B are incorrect.
James R. Ferguson
Acclaimed Contributor

Re: TZTAB Modified TIME ZONE Not Correct

HI:

> So from what you are saying Server A and Server B are incorrect.

The 'tztab' on Server-A needs to be updated.

Both servers need to have their true time verified and corrected to UTC. This is why I said, match your:

# date -u

...to a source like:

http://tycho.usno.navy.mil/cgi-bin/anim

Regards!

...JRF...
Regina Mitchell
Frequent Advisor

Re: TZTAB Modified TIME ZONE Not Correct

These servers are located in Mexico. I'm told that server A is correct. I should have mentioned that earlier but I forgot.

So I still need to change Server B to match A.

James R. Ferguson
Acclaimed Contributor

Re: TZTAB Modified TIME ZONE Not Correct

Hi (again):

> These servers are located in Mexico. I'm told that server A is correct. I should have mentioned that earlier but I forgot.

Don't just copy 'tztab' files from server to server. Rather: (1) fetch a current patch as I noted; (2) READ the patch's special installation instructions; (3) verify and/or reset your actual UTC time; and (4) use the proper TZ setting.

There is a Mexican variation:

# TZ=CST6CDT date
Thu Oct 29 14:50:14 CDT 2009

# TZ=CST6CDT#Mexico date
Thu Oct 29 13:50:35 CST 2009

Lastly, when everything is corrected, make sure that you are running NTP (which works in UTC) to maintain an accurate server time.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: TZTAB Modified TIME ZONE Not Correct

> These servers are located in Mexico.

This is most likely broken. Mexico should not be using timezones reserved for the US. Mexico didn't follow along with the DST changes in the US.
http://www.hp.com/go/dst

>JRF: # TZ=CST6CDT#Mexico date

Right, this is better but it would be nicer if it showed "Mexico" on the date result.
Matti_Kurkela
Honored Contributor

Re: TZTAB Modified TIME ZONE Not Correct

Note that a comment in a reasonably-updated tztab file says:
----
It is recommended to use PSM8PDM, MSM7MDM, CSM6CDM and MXST6MXDT for Mexico.
Timezones PST8PDT#Mexico, MST7MDT#Mexico, CST6CDT#Mexico and MXST6MXDT#Mexico
are kept for the compatibility reasons. Content of either set is same.
----

In other words, when the new DST policy for USA (and Canada) was introduced, HP defined new timezone designators specifically for Mexico.

If you want to use the compatibility versions, remember that the "#" sign is also a comment indicator in shell scripts. Therefore it *must* be quoted in /etc/TIMEZONE, e.g.

TZ="CST6CDT#Mexico"
export TZ

MK
MK
Dennis Handly
Acclaimed Contributor

Re: TZTAB Modified TIME ZONE Not Correct

>MK: remember that the "#" sign is also a comment indicator in shell scripts. Therefore it *must* be quoted in /etc/TIMEZONE

No. A real shell must have whitespace before the "#" before it is a comment. Only the scummy C shell has a problem.
$ x=abc#def
$ echo $x
abc#def

It still may be a good idea to use quotes.