1847203 Members
3252 Online
110263 Solutions
New Discussion

Re: tztab issue

 
SOLVED
Go to solution

tztab issue

how work ?
I changed tztab file for insert a new timezone for Brazil, like this:

# Brazil Eastern Standard Time, Brazil Eastern Daylight Time
# horario verao

EBST3EBDT
0 0 4-10 11 2006 0 EBST3
0 0 22-28 2 2007 0 EBST4
0 0 4-10 11 2007 0 EBDT3

and i changed the TZ variable but the time doesn´t changed.
what is the next step?

thanks.
14 REPLIES 14
Steven E. Protter
Exalted Contributor
Solution

Re: tztab issue

Shalom,

TZ variable only effects how time is displayed. Time is calculated from the number of seconds since Jan 1, 1970.

I believe a fresh login should display time correctly.

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

Re: tztab issue

I'm sorry but i think i didn´t explain correctly.
For ex.: when i logon into the so (HP-UX 11.11) and the user set the variable
TZ=MET-1METDST , the system show me the time UTC+2. That's right.
But,
when i set variable TZ=EBST3EBDT (for BRAZIL) the system show me time UTC-2, and that's wrong, cause in Brazil (Brasilia) the time now is UTC-3.
That's the problem and i thought the solution is to change tztab file for that timezone, but i think i have to do something more, like to compile a library or something like that.
James R. Ferguson
Acclaimed Contributor

Re: tztab issue

Hi:

> when i set variable TZ=EBST3EBDT (for BRAZIL) the system show me time UTC-2, and that's wrong, cause in Brazil (Brasilia) the time now is UTC-3.
That's the problem and i thought the solution is to change tztab file for that timezone, but i think i have to do something more, like to compile a library or something like that.

There is nothing to compile. The sole change is to the '/usr/lib/tztab'. Then, in '/etc/TIMEZONE' set your new TZ specification if you want *all* users to see this view. If only your login should see this localtime, export TZ=EBST3EBDT from your '${HOME}/.profile'.

Your TZTAB looks ok. Try:

# TZ=EBST3EBDT date
# TZ=UTC date

There is no semicolon after the TZ value. This sets the variable only for the duration of the commaned (the 'date' command here).

Regards!

...JRF...

Re: tztab issue

Hi James,
Thanks for your answer but i already had tried this before and the system show me
UTC-2 and that is wrong.

Are there any service for Timezone to restart?

James R. Ferguson
Acclaimed Contributor

Re: tztab issue

Hi (again):

> Are there any service for Timezone to restart?

No and yes. Processes that have already started running before the file's change need to be restarted. The 'cron' daemon is probably the most notable example, although databases are good representatives too. New processes started since the change will see the new rules. The libC library routines handle the file's interpretation.

Regards!

...JRF...

Re: tztab issue

Sorry James, but i don't know what is your propose exactly.
Dennis Handly
Acclaimed Contributor

Re: tztab issue

Are you in the southern hemisphere?
I would think that Brazil wouldn't have DST since it is so near the equator?

EBST3EBDT
0 0 4-10 11 2006 0 EBST3
0 0 22-28 2 2007 0 EBST4
0 0 4-10 11 2007 0 EBDT3

This isn't correct. If you have EBST, it must be followed by "3", not 4. And EBDT should be followed by "2".

Please explain in words what you want to have in your timezone.

Using your TZ settings I get:
$ TZ=GMT0 date
Fri Jul 13 04:56:29 GMT 2007
$ TZ=EBST3EBDT date
Fri Jul 13 00:56:30 EBST 2007

So between Feb 25 and Nov 4, it is 4 hours behind GMT, and you are in EBST.

>but i don't know what is your propose exactly.

JRF is trying to tell you that there are some processes that require a reboot. There are others that just setting TZ will cause an immediate change.

Re: tztab issue

Hi Dennis,

You're right, it was a 'copy&paste' error.
The tztab that i have is:

EBST3EBDT
0 0 4-10 11 2006 0 EBDT2
0 0 22-28 2 2007 0 EBST3
0 0 4-10 11 2007 0 EBDT2

and using TZ settings i get:

$ TZ=GMT0 date
Fri Jul 13 07:25:48 GMT 2007
$ TZ=EBST3EBDT date
Fri Jul 13 05:25:50 EBDT 2007

and the last is wrong cause it will be:
Fri Jul 13 04:25:50 EBDT 2007





Dennis Handly
Acclaimed Contributor

Re: tztab issue

What libc patch do you have?

I had problems with 11.22 but 11.11, 11.23 and 11.31 work fine:
$ TZ=GMT0 date
Fri Jul 13 19:08:06 GMT 2007
$ TZ=EBST3EBDT date
Fri Jul 13 16:08:09 EBST 2007
$ TZ=EBST3EBDT dst.pl
Sun Feb 25 00:59:59 EBDT 2007 --> Sun Feb 25 00:00:00 EBST 2007
Sat Nov 03 22:59:59 EBST 2007 --> Sun Nov 04 00:00:00 EBDT 2007

Note: Typically all of the xDT rules are before the xST rules. See Australia.
Dennis Handly
Acclaimed Contributor

Re: tztab issue

>and the last is wrong cause it will be:
Fri Jul 13 04:25:50 EBDT 2007

No, with your rules, it is EBST.
Dennis Handly
Acclaimed Contributor

Re: tztab issue

BTW, your date range 4-10 seems strange. While easy to explain in NERD or tztab format, seems to be strange in any legalese I've seen. It would be the Sunday that's in the date range from the 4th to 10th.

Or more traditional legalese, the first Sunday in Nov that is after the first Thursday.

Re: tztab issue

Thanks all,
The system works fine.
I change the tztab adding:

# Brazil Eastern Standard Time, Brazil Eastern Daylight Time
# horario verao

BEST3BEDT
0 0 4-10 11 2006 0 BEDT2
0 0 22-28 2 2007 0 BEST3
0 0 4-10 11 2007 0 BEDT2

and when i check:
$ TZ=GMT0 date
Mon Jul 16 13:06:38 GMT 2007
$ TZ=BEST3BEDT date
Mon Jul 16 10:06:41 BEST 2007
$ TZ=BEST3BEDT dst.pl
Sun Feb 25 00:59:59 BEDT 2007 --> Sun Feb 25 00:00:00 BEST 2007
Sat Nov 03 22:59:59 BEST 2007 --> Sun Nov 04 00:00:00 BEDT 2007

it's ok !

the problem were tztab format (more than one spaces between numbers).

bye.

Re: tztab issue

Thanks all,
The system works fine.
I change the tztab adding:

# Brazil Eastern Standard Time, Brazil Eastern Daylight Time
# horario verao

BEST3BEDT
0 0 4-10 11 2006 0 BEDT2
0 0 22-28 2 2007 0 BEST3
0 0 4-10 11 2007 0 BEDT2

and when i check:
$ TZ=GMT0 date
Mon Jul 16 13:06:38 GMT 2007
$ TZ=BEST3BEDT date
Mon Jul 16 10:06:41 BEST 2007
$ TZ=BEST3BEDT dst.pl
Sun Feb 25 00:59:59 BEDT 2007 --> Sun Feb 25 00:00:00 BEST 2007
Sat Nov 03 22:59:59 BEST 2007 --> Sun Nov 04 00:00:00 BEDT 2007

it's ok !

the problem were tztab format (more than one spaces between numbers).

bye.
Dennis Handly
Acclaimed Contributor

Re: tztab issue

>The problem were tztab format (more than one spaces between numbers).

That's strange. tztab(4) says:
The fields are separated by spaces or tabs.