Proposed change to zic.c and northamerica
Olson, Arthur David (NIH/NCI)
olsona at dc37a.nci.nih.gov
Tue Mar 2 16:01:03 UTC 2004
Getting a jump on DST season, here are proposed minor changes to zic.c and
northamerica.
The zic.c changes allow rules containing specifications such as...
Sun>=25
...to go past the end of a month; this allows simpler descriptions of the
sort of situation that existed in Toronto between 1927 and 1937.
Commentary is added to the northamerica file indicating how things could be
made simpler, but the data is kept as is to allow folks to continue to use
it with pre-2004 versions of zic.
(The motive in making the change to zic is to ensure that zic can handle it
if some jurisdiction adopts a similar scheme in the future.)
--ado
------- zic.c -------
*** /tmp/geta957 Tue Mar 2 10:54:54 2004
--- /tmp/getb957 Tue Mar 2 10:54:55 2004
***************
*** 1,4 ****
! static char elsieid[] = "@(#)zic.c 7.115";
#include "private.h"
#include "locale.h"
--- 1,4 ----
! static char elsieid[] = "@(#)zic.c 7.116";
#include "private.h"
#include "locale.h"
***************
*** 2139,2146 ****
--i;
}
if (i < 0 || i >= len_months[isleap(y)][m]) {
! error(_("no day in month matches rule"));
! (void) exit(EXIT_FAILURE);
}
}
if (dayoff < 0 && !TYPE_SIGNED(time_t))
--- 2139,2146 ----
--i;
}
if (i < 0 || i >= len_months[isleap(y)][m]) {
! if (noise)
! warning(_("rule goes past start/end of
month--will not work with pre-2004 versions of zic"));
}
}
if (dayoff < 0 && !TYPE_SIGNED(time_t))
------- northamerica -------
*** /tmp/geta975 Tue Mar 2 10:54:55 2004
--- /tmp/getb975 Tue Mar 2 10:54:55 2004
***************
*** 1,4 ****
! # @(#)northamerica 7.67
# also includes Central America and the Caribbean
# This data is by no means authoritative; if you think you know better,
--- 1,4 ----
! # @(#)northamerica 7.68
# also includes Central America and the Caribbean
# This data is by no means authoritative; if you think you know better,
***************
*** 989,994 ****
--- 989,1001 ----
# Shanks says 1923-09-19; assume it's a typo and that "-16" was meant.
Rule Toronto 1922 1926 - Sep Sun>=15 2:00 0 S
Rule Toronto 1924 1927 - May Sun>=1 2:00 1:00 D
+ # The 1927-to-1939 rules can be expressed more simply as
+ # Rule Toronto 1927 1937 - Sep Sun>=25 2:00 0
S
+ # Rule Toronto 1928 1937 - Apr Sun>=25 2:00 1:00
D
+ # Rule Toronto 1938 1940 - Apr lastSun 2:00 1:00
D
+ # Rule Toronto 1938 1939 - Sep lastSun 2:00 0
S
+ # The rules below avoid use of Sun>=25
+ # (which pre-2004 versions of zic cannot handle).
Rule Toronto 1927 1932 - Sep lastSun 2:00 0 S
Rule Toronto 1928 1931 - Apr lastSun 2:00 1:00 D
Rule Toronto 1932 only - May 1 2:00 1:00 D
More information about the tz
mailing list