Simultaneous zone and DST changes

Arthur David Olson ado
Tue May 14 18:31:50 UTC 1996


The basic challenge with places such as Stanley (where a time-zone shift and
a DST change were done at the same instant in 1985, resulting in no change of
wall clock time) is that there's an hour when such a place is neither fish nor
fowl. Here's a table summarizing what's happening on September 14/15 1995
in five different circumstances; each row of the table gives data for a
particular instant in time. The circumstances:
	1. What's happening in places that run on GMT
	2. What's happening in (hypothetical) places that always run on EST/EDT
	   using Falkland rules
	3. What's happening in (hypothetical) places that always run on AST/ADT
	   using Falkland rules
	4. What zdump tells us is currently produced by zic for Stanley
	5. And what we (presumably) really want for Stanley.
===============================================================================
GMT-------|Always-ExT-----|Always-AxT-----|Stanley (now)--|Stanley (wanted)
15 2:59:59|14 23:59:59 EST|14 22:59:59 AST|14 23:59:59 EST|14 23:59:59 EST
15 3:00:00|15 01:00:00 EDT|14 23:00:00 AST|14 23:00:00 AST|15 00:00:00 ADT/EST
15 3:59:59|15 01:59:59 EDT|14 23:59:59 AST|14 23:59:59 AST|15 00:59:59 ADT/EST
15 4:00:00|15 02:00:00 EDT|15 01:00:00 ADT|15 01:00:00 ADT|15 01:00:00 ADT
===============================================================================
The "Stanley (wanted)" stuff matches neither the "Always ExT" stuff nor the
"Always AxT" stuff (regardless of whether you pick ADT or EST for Stanley to
use as a time zone abbreviation during the strange hour).

Among the ways to get from "Stanley (now)" to "Stanley (wanted)":

1. Hard code the transition hour--that is, where there are now lines that read...

	Zone Atlantic/Stanley	-3:51:24 -	LMT	1890
				-3:51	-	SMT	1912 Mar 12
				-4:00	Falk	A%sT	1983 May
				-3:00	Falk	E%sT	1985 Sep 15
				-4:00	Falk	A%sT

...add a line to cover the hour in 1985...

	Zone Atlantic/Stanley	-3:51:24 -	LMT	1890
				-3:51	-	SMT	1912 Mar 12
				-4:00	Falk	A%sT	1983 May
				-3:00	Falk	E%sT	1985 Sep 15
				-3:00	-	EST	1985 Sep 15 1:00 # <<<<
				-4:00	Falk	A%sT

2. Set up zic to notice situations such as the above and "do the right thing."
   This would involve a code change something like this (with the "horrid
   special case" check perhaps made more strict):
===============================================================================
SCCS/s.zic.c: 7.74 vs. 7.75
*** 7.74/zic.c	Tue May 14 14:25:04 1996
--- 7.75/zic.c	Tue May 14 14:25:06 1996
***************
*** 1,6 ****
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)zic.c	7.74";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
--- 1,6 ----
  #ifndef lint
  #ifndef NOID
! static char	elsieid[] = "@(#)zic.c	7.75";
  #endif /* !defined NOID */
  #endif /* !defined lint */
  
***************
*** 1397,1406 ****
  		if (isdsts[0] == 0)
  			while (attypes[fromi].type == 0)
  				++fromi;	/* handled by default rule */
! 		for ( ; fromi < timecnt; ++fromi)
  			if (toi == 0 ||
  				attypes[toi - 1].type != attypes[fromi].type)
  					attypes[toi++] = attypes[fromi];
  		timecnt = toi;
  	}
  	/*
--- 1397,1414 ----
  		if (isdsts[0] == 0)
  			while (attypes[fromi].type == 0)
  				++fromi;	/* handled by default rule */
! 		for ( ; fromi < timecnt; ++fromi) {
! 			/*
! 			** Horrid special case.
! 			*/
! 			if ((fromi + 1) < timecnt &&
! 				attypes[fromi + 1].at - attypes[fromi].at ==
! 				SECSPERHOUR)
! 					continue;
  			if (toi == 0 ||
  				attypes[toi - 1].type != attypes[fromi].type)
  					attypes[toi++] = attypes[fromi];
+ 		}
  		timecnt = toi;
  	}
  	/*
===============================================================================
I lean toward the second approach; are there any better ideas out there?

				--ado



More information about the tz mailing list