Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

Daylight savings time changes using zic

John Liden
Advisor

Daylight savings time changes using zic

Hi all
I have been trying to modify the zoneinfo source files to change to the new Dates using zic. I do modify the source file for northamerica but nothing seems to change even though the date stamp changes.

Any help would be wonderfull
John

Kindest Regards, John
Gambro BCT/Products
Sr Unix System Admin
John Liden
303-542-5082 office _
720-253-8325 cell
7 REPLIES
Archunan Muthiah
Honored Contributor

Re: Daylight savings time changes using zic

John,

you could have given the OS version and patch details.

Anyway this thread may be usefull....
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1094997

Archunan
God is Artist, we are all just brushes
John Liden
Advisor

Re: Daylight savings time changes using zic

sorry about that the box I am testing on is a 4100 running Compaq Tru64 UNIX V5.1B (Rev. 2650)

Found that the Rule US handled the spring forward but don't seem to be able to change the Fall back dates.

Rule US 2007 max - Apr Sun>=1 2:00 1:00 D
Martin Moore
HPE Pro

Re: Daylight savings time changes using zic

First, you should post the actual changes that you've made to the northamerica file.

After making the changes to northamerica, recompile the timezone files:

# cd /etc/zoneinfo/sources
# zic northamerica

Note that if you're on V5 and also using the backward-compatible (old-style) timezones such as EST5EDT, you *also* need to run "zic backward" after running "zic northamerica".

Finally, how are you testing the change? If you're using "date" to set the system time to just before the time change on March 11 and Nov. 4, be very careful about the second one. If you try to set the time to something like 01:55 on Nov. 4, remember that there are *two* occurrences of 01:55 (or any other time from 01:00 to 01:59) on the day that daylight time reverts to standard time. 01:55 EDT occurs before the change, while 01:55 EST occurs after the change. The date command will set the system time to 01:55 EST, and you won't see the time change because the system time is already past it!

There are a couple of ways to work around this behavior of the date command:

1. Set the time to something like 00:55 on Nov. 4 and wait a little over an hour to verify the change.

2. Go through another timezone such as GMT to force the time to 01:55 daylight time in your timezone. Let's say you're using America/New_York (Eastern time). You could:

a. Set the timezone to GMT
b. Set the system time to 05:55 on Nov 4 (05:55 GMT = 01:55 EDT)
c. Set the timezone back to America/New_York
d. Verify that the system time is 01:55 EDT, not EST
e. Wait five minutes to verify the change

Hope this helps,
Martin
I work for HP
A quick resolution to technical issues for your HP Enterprise products is just a click away HP Support Center Knowledge-base
See Self Help Post for more details

John Liden
Advisor

Re: Daylight savings time changes using zic

Thanks Martin. A lot of good info there.

The change that I made to the northamerica file is the last line on the pervious post.

I am checking 2 ways.
1. I am looking at the output of zdump -c 2008 -v Denver
I am able to see the change for spring ahead but I can't seem to find a parameter that changes the Fall back date.
2. I also modified the DST date to be last Sunday and sure enough it changed.

I have modified the Denver section of the northamerica file several different ways to no avail.
Rule Denver 2007 Max - Nov Sun>=1 2:00 0 S
Should work but doesn't
Martin Moore
HPE Pro

Re: Daylight savings time changes using zic

John,

The Denver rule is not the one you need to modify. The timezone files work as follows: you look at the Zone you're in, and see how the Zone is modified by Rules. You're presumably using the America/Denver zone, which is defined as:


# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Denver -6:59:56 - LMT 1883 Nov 18 12:00:04
-7:00 US M%sT 1920
-7:00 Denver M%sT 1942
-7:00 US M%sT 1946
-7:00 Denver M%sT 1967
-7:00 US M%sT

This shows that the Zone "America/Denver" is currently using the Rule "US", and has been using it since 1967. The *Rule* "Denver" was in use before that, from 1946 to 1967.

So the Rule that you need to modify is "US", not "Denver". This is fairly easy. The rule before modification looks like this:

# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule US 1918 1919 - Mar lastSun 2:00 1:00 W # War
Rule US 1918 1919 - Oct lastSun 2:00 0 S
Rule US 1942 only - Feb 9 2:00 1:00 W # War
Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace
Rule US 1945 only - Sep 30 2:00 0 S
Rule US 1967 max - Oct lastSun 2:00 0 S
Rule US 1967 1973 - Apr lastSun 2:00 1:00 D
Rule US 1974 only - Jan 6 2:00 1:00 D
Rule US 1975 only - Feb 23 2:00 1:00 D
Rule US 1976 1986 - Apr lastSun 2:00 1:00 D
Rule US 1987 max - Apr Sun>=1 2:00 1:00 D

Change "max" to "2006" in both places where it appears above, and then add two new lines to define the new time changes:

Rule US 2007 max - Mar Sun>=8 2:00 1:00 D
Rule US 2007 max - Nov Sun>=1 2:00 0 S

This will cover the US changes in V5. (Canada is a little trickier.)

Regards,
Martin
I work for HP
A quick resolution to technical issues for your HP Enterprise products is just a click away HP Support Center Knowledge-base
See Self Help Post for more details

John Liden
Advisor

Re: Daylight savings time changes using zic

Nice! You know your stuff that nailed it.

thanks so much
John
John Liden
Advisor

Re: Daylight savings time changes using zic

Guess that covers it