1825009 Members
3598 Online
109678 Solutions
New Discussion юеВ

Time Zone TZ New Zealand

 
SOLVED
Go to solution
kate32
Frequent Advisor

Time Zone TZ New Zealand

Hi,

What is the correct timezone for New Zealand:
TZ=NZST-12NZDT or NZST-12NZDT,M9.5.0/02:00,M4.1.0/03:00 ?

Need to be sure it is setted correctly before the new change date in September

Cheers
K
17 REPLIES 17
Dennis Handly
Acclaimed Contributor
Solution

Re: Time Zone TZ New Zealand

The first format will only work if you have an entry for NZST-12NZDT in /usr/lib/tztab.
The latter is only valid for years with that rule. Obviously, if there is a "new change", it isn't valid for making time queries for last year. Only by using tztab, can you create rules that are valid to the beginning of the epoch.
kate32
Frequent Advisor

Re: Time Zone TZ New Zealand

Thanks
So I will put on the file /etc/TIMEZONE
the TZ=NZST-12NZDT
Thanks again
Dennis Handly
Acclaimed Contributor

Re: Time Zone TZ New Zealand

>So I will put on the file /etc/TIMEZONE the TZ=NZST-12NZDT

Changing /etc/TIMEZONE alone won't work correctly unless you also change /usr/lib/tztab.

My tztab has an entry for NZST-12NZDT but it doesn't have your recent rule change.

Do you know how to translate "NZST-12NZDT,M9.5.0/02:00,M4.1.0/03:00" to the tztab format?

You haven't assigned any points yet. Please read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
kate32
Frequent Advisor

Re: Time Zone TZ New Zealand

Hi

sorry for the delay.

Well it looks like complicated on HP system for the time zone. I didn;t realise that we do not change the value of TZ but have to modify the file /usr/lib/tztab instead.

On ibm aix for example you jsut modify the TZ variable to the good one...
So I was confused.

I have a question: If we install the latest patch of Timezone do this come with the new file version of /usr/lib/tztab or do I need to modify it ?

Thanks a lot in advance.

Cheers
Al.
James R. Ferguson
Acclaimed Contributor

Re: Time Zone TZ New Zealand

Hi:

> Well it looks like complicated on HP system for the time zone. I didn;t realise that we do not change the value of TZ but have to modify the file /usr/lib/tztab instead.

It isn't complicated on HP-UX at all. In fact, I find it simplier than Linux or AIX. You can set the TZ variable in your login '.profile' or set it system-wide in '/etc/TIMEZONE' (which in turn, will be sourced (read) by '/etc/profile' during login).

The *RULES* (definitions for a timezone) are what are held in '/usr/lib/tztab'. You can define your own if necessary simply by adding stanzas as documented in the manpages for 'tztab(4)'. Patches are usually released in plenty of time to accomodate world-wide TZ rule changes.

Moreoever, the HP-UX '/usr/lib/tztab' is an ASCII file that you edit directly. There is no "de-compilation" and "recompilation from a binary to an ASCII and from an ASCII to a binary format as in AIX.

> On ibm aix for example you jsut modify the TZ variable to the good one...So I was confused.

As you see from the above, this is really similar when you are choosing among established rules. In HP-UX, you modify either your '.profile' or '/etc/TIMEZONE'. In AIX, you modify '/etc/environment' (manually or with AIX's 'chtz').

> I have a question: If we install the latest patch of Timezone do this come with the new file version of /usr/lib/tztab or do I need to modify it ?

NO, the recent patches accomodate universal, standard definitions. To find the latest patch, search the ITRC Patch database with the keyword "tztab". For example, PHCO_36098 delivers the latest 'tztab' for 11.23.

When you modify a global setting or add a new ruleset, restart any long running processes like 'cron' and databases. THis allows them to re-cache the new rules. While a reboot is not strictly necessary it is the cleanest way to obtain consistent, system-wide process definition.

Please also see:

http://forums1.itrc.hp.com/service/forums/helptips.do?#28

Regards!

...JRF...
kate32
Frequent Advisor

Re: Time Zone TZ New Zealand

Hi,

Thank you very much for your reply.
Well I can close this post now as I have all the information and it is more clear now.

Thanks again.
cheers
K
kate32
Frequent Advisor

Re: Time Zone TZ New Zealand

Thanks for your help
Dennis Handly
Acclaimed Contributor

Re: Time Zone TZ New Zealand

>I didn't realise that we do not change the value of TZ but have to modify the file /usr/lib/tztab instead.

This is incorrect. You can do either (or both :-). While the setting of TZ is standard, it only works in the current year, as I said before, not previous. Using tztab(4) will work in all years.

>AIX for example you just modify the TZ variable

Yes, you can still do that, see TZ under environ(5).

>If we install the latest patch of Timezone do this come with the new file version of /usr/lib/tztab or do I need to modify it?

Looking at PHCO_36098 that JRF mentioned, I see no mention of New Zealand. When was this passed into law? In the US, we had almost 2.5 years to get ready.

>JRF: Patches are usually released in plenty of time to accommodate world-wide TZ rule changes.

I don't see one for New Zealand yet.
Dennis Handly
Acclaimed Contributor

Re: Time Zone TZ New Zealand

>I don't see one for New Zealand yet.

Ok, I looked when I got back to work. There seems to be patches in progress. CR JAGag42510
The defect will be fixed by patches:
PHCO_36823: 11.11
PHCO_36824: 11.23
PHCO_36825: 11.31

Dennis Handly
Acclaimed Contributor

Re: Time Zone TZ New Zealand

Copied from:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1137204

Why are you asking questions in Alex's thread?
You have your own. Just reopen it.

Also you have not assigned any points yet, this is not mutual, please read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33

>kate32: I will do it.

>>Also you have not assigned any points yet, this is not mutual =>

>I am not a specialist HP and don't want yet to give maybe wrong information. Not yet ready maybe in few months I will start.
>sorry for that.

The points are assigned based on how valuable the answers are to YOU. You don't need to be an expert to determine that.
http://forums1.itrc.hp.com/service/forums/helptips.do?#28

If you don't assign points, you will be struck off and you run the risk that nobody will answer your questions. :-)

You can reopen this thread by:
http://forums1.itrc.hp.com/service/forums/helptips.do?#41

Your list of threads without points is:
http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA1470695&listType=unassigned&forumId=1
kate32
Frequent Advisor

Re: Time Zone TZ New Zealand

Hi,

Sorry, I didn't get it about the points I thought it was make some answer to help other people on hp-ux and it is for that I said I amn not specialist...

Oh sorry for my misunderstood...

I will do it now...
Cheers
K.
kate32
Frequent Advisor

Re: Time Zone TZ New Zealand

Hi,

I have checked the contain of the patch but the step to gzip the file can;t be done as I have found a awk program not a zip file...
sh /tmp/PHCO_36096
file PHCO_36096/UX-CORE/usr/newconfig/usr/lib/tztab: awk program text



The steps that I followed:
sh /tmp/PHCO_36096
tar -tvf /tmp/PHCO_36096.depot
rw-r--r-- 0/3 2140 Feb 28 19:08 2007 catalog/INDEX
rw-r--r-- 0/3 561 Feb 28 19:08 2007 catalog/dfiles/INDEX
rw-r--r-- 0/3 138 Feb 28 19:08 2007 catalog/dfiles/INFO
r--r--r-- 0/3 908 Feb 23 16:21 2007 catalog/PHCO_36096/pfiles/INDEX
r--r--r-- 0/3 465 Feb 23 16:21 2007 catalog/PHCO_36096/pfiles/INFO
r--r--r-- 0/3 17578 Feb 23 16:21 2007 catalog/PHCO_36096/pfiles/README
r-xr--r-- 0/3 1813 Feb 23 16:20 2007 catalog/PHCO_36096/pfiles/preinstall
r-xr--r-- 0/3 2099 Feb 23 16:20 2007 catalog/PHCO_36096/pfiles/preremove
r--r--r-- 0/3 671 Feb 23 16:21 2007 catalog/PHCO_36096/UX-CORE/INDEX
r--r--r-- 0/3 616 Feb 23 16:21 2007 catalog/PHCO_36096/UX-CORE/INFO
r--r--r-- 2/2 3855 Feb 23 16:17 2007 PHCO_36096/UX-CORE/usr/lib/tztab
r--r--r-- 2/2 3855 Feb 23 16:06 2007 PHCO_36096/UX-CORE/usr/newconfig/usr/lib/tztab

tar -xvf /tmp/PHCO_36096.depot
and then check files type first:
file PHCO_36096/UX-CORE/usr/lib/tztab PHCO_36096/UX-CORE/usr/newconfig/usr/lib/tztab
PHCO_36096/UX-CORE/usr/lib/tztab: awk program text
PHCO_36096/UX-CORE/usr/newconfig/usr/lib/tztab: awk program text

How I can extract the file tztab from the awk file ?

Thanks in advance.
Cheers
K.
Dennis Handly
Acclaimed Contributor

Re: Time Zone TZ New Zealand

>I didn't get it about the points I thought it was make some answer to help other people on hp-ux

It does. If the answer helps you, it is likely to help others.

>How I can extract the file tztab from the awk file?

tztab isn't a known file type defined in magic(4), so file(1) just guesses it is an awk file.
The file you got is the right type. I was expecting it to say: gzip compressed

Oops, this is all wrong. You are on 11.00 so you don't have the latest magic(4), so what is really a gzipped file shows up as awk.
(You could get a new version of /etc/magic too. :-)

So you need to do the gunzip stuff:
# mv PHCO_36096/UX-CORE/usr/lib/tztab tztab.gz
# gunzip tztab.gz

Now you have a tztab that you can look at in vi or more.

Just move it into place into /usr/lib/. If you want, you can save the old one first.
I would move it aside so it saves the date. But you need to move the new one in place quickly. You can do the following to make this almost atomic:
# cp tztab /usr/lib/tztab.new
# ln /usr/lib/tztab /usr/lib/tztab.old
# mv -f /usr/lib/tztab.new /usr/lib/tztab
kate32
Frequent Advisor

Re: Time Zone TZ New Zealand

THANK YOU!!!!

it works fine:
file *
tztab: ascii text

Again you are too good!
Cheers
K.
Dennis Handly
Acclaimed Contributor

Re: Time Zone TZ New Zealand

>Again you are too good!

No extra credit points for your gzip question? :-)
kate32
Frequent Advisor

Re: Time Zone TZ New Zealand

Hi,

Sorry for that. I was sure yesterday I do assigned point for your post but don;t understand why it wasn't submit ... I should do again something wrong sorry for that.

Now I have rechecked and it is allocated.

Thank you again for your help.
Cheers
K.
kate32
Frequent Advisor

Re: Time Zone TZ New Zealand

Thanks Denis for all your help and patience ;-)
Cheers
K.