european timezone rules
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Sun, 10 Jul 1983 05:03:10 +0000 (21:03 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Sun, 10 Jul 1983 05:03:10 +0000 (21:03 -0800)
SCCS-vsn: lib/libc/gen/ctime.c 4.4
SCCS-vsn: lib/libc/gen/timezone.c 4.3

usr/src/lib/libc/gen/ctime.c
usr/src/lib/libc/gen/timezone.c

index 5d2db22..9a62e01 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)ctime.c    4.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)ctime.c    4.4 (Berkeley) %G%";
 #endif
 /*
  * This routine converts time as follows.
 #endif
 /*
  * This routine converts time as follows.
@@ -19,9 +19,7 @@ static char sccsid[] = "@(#)ctime.c   4.3 (Berkeley) %G%";
  *
  * The routine calls the system to determine the local
  * timezone and whether Daylight Saving Time is permitted locally.
  *
  * The routine calls the system to determine the local
  * timezone and whether Daylight Saving Time is permitted locally.
- * (DST is then determined by the current US standard rules)
- * There is a table that accounts for the peculiarities
- * undergone by daylight time in 1974-1975.
+ * (DST is then determined by the current local rules)
  *
  * The routine does not work
  * in Saudi Arabia which runs on Solar time.
  *
  * The routine does not work
  * in Saudi Arabia which runs on Solar time.
@@ -81,6 +79,30 @@ static struct dstab ausdaytab[] = {
        0,      303,    65,     /* others: -> Mar 7, Oct 31 -> */
 };
 
        0,      303,    65,     /* others: -> Mar 7, Oct 31 -> */
 };
 
+/*
+ * The European tables ... based on hearsay
+ * Believed correct for:
+ *     WE:     Great Britain, Ireland, Portugal
+ *     ME:     Belgium, Luxembourg, Netherlands, Denmark, Norway,
+ *             Austria, Poland, Czechoslovakia, Sweden, Switzerland,
+ *             DDR, DBR, France, Spain, Hungary, Italy, Jugoslavia
+ * Eastern European dst is unknown, we'll make it ME until someone speaks up.
+ *     EE:     Bulgaria, Finland, Greece, Rumania, Turkey, Western Russia
+ */
+static struct dstab wedaytab[] = {
+       1983,   86,     303,    /* 1983: end March - end Oct */
+       1984,   86,     303,    /* 1984: end March - end Oct */
+       1985,   86,     303,    /* 1985: end March - end Oct */
+       0,      400,    0,      /* others: no daylight saving at all ??? */
+};
+
+static struct dstab medaytab[] = {
+       1983,   86,     272,    /* 1983: end March - end Sep */
+       1984,   86,     272,    /* 1984: end March - end Sep */
+       1985,   86,     272,    /* 1985: end March - end Sep */
+       0,      400,    0,      /* others: no daylight saving at all ??? */
+};
+
 static struct dayrules {
        int             dst_type;       /* number obtained from system */
        int             dst_hrs;        /* hours to add when dst on */
 static struct dayrules {
        int             dst_type;       /* number obtained from system */
        int             dst_hrs;        /* hours to add when dst on */
@@ -89,6 +111,9 @@ static struct dayrules {
 } dayrules [] = {
        DST_USA,        1,      usdaytab,       NTH,
        DST_AUST,       1,      ausdaytab,      STH,
 } dayrules [] = {
        DST_USA,        1,      usdaytab,       NTH,
        DST_AUST,       1,      ausdaytab,      STH,
+       DST_WET,        1,      wedaytab,       NTH,
+       DST_MET,        1,      medaytab,       NTH,
+       DST_EET,        1,      medaytab,       NTH,    /* XXX */
        -1,
 };
 
        -1,
 };
 
index eac9e09..a051d34 100644 (file)
@@ -1,4 +1,4 @@
-/* @(#)timezone.c      4.2 (Berkeley) %G% */
+/* @(#)timezone.c      4.3 (Berkeley) %G% */
 /*
  * The arguments are the number of minutes of time
  * you are westward from Greenwich and whether DST is in effect.
 /*
  * The arguments are the number of minutes of time
  * you are westward from Greenwich and whether DST is in effect.
@@ -13,12 +13,18 @@ static struct zone {
        char    *stdzone;
        char    *dlzone;
 } zonetab[] = {
        char    *stdzone;
        char    *dlzone;
 } zonetab[] = {
+       1*60, "MET", "MET DST",         /* Middle European */
+       2*60, "EET", "EET DST",         /* Eastern European */
        4*60, "AST", "ADT",             /* Atlantic */
        5*60, "EST", "EDT",             /* Eastern */
        6*60, "CST", "CDT",             /* Central */
        7*60, "MST", "MDT",             /* Mountain */
        8*60, "PST", "PDT",             /* Pacific */
        4*60, "AST", "ADT",             /* Atlantic */
        5*60, "EST", "EDT",             /* Eastern */
        6*60, "CST", "CDT",             /* Central */
        7*60, "MST", "MDT",             /* Mountain */
        8*60, "PST", "PDT",             /* Pacific */
+#ifdef notdef
+       /* there's no way to distinguish this from WET */
        0, "GMT", 0,                    /* Greenwich */
        0, "GMT", 0,                    /* Greenwich */
+#endif
+       0*60, "WET", "WET DST",         /* Western European */
        -10*60, "EST", "EST",           /* Aust: Eastern */
        -10*60+30, "CST", "CST",        /* Aust: Central */
        -8*60, "WST", 0,                /* Aust: Western */
        -10*60, "EST", "EST",           /* Aust: Eastern */
        -10*60+30, "CST", "CST",        /* Aust: Central */
        -8*60, "WST", 0,                /* Aust: Western */