This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch] BZ#14080: Fix daylight time change for the US


I was suprised to see that glibc source code contains information
about the US daylight saving time but it does - and its outdated.

The patch below has been tested on Linux/x86-64.

Ok to commit?

Andreas

2012-05-08  Ian Wienand  <ianw@vmware.com>

	* time/tzset.c (__tzset_parse_tz): Update default rules for
	daylight time changes in the Energy Policy Act of 2005.

diff --git a/time/tzset.c b/time/tzset.c
index a2d2972..4efc0c7 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2002,2003,2004,2007,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -333,18 +333,24 @@ __tzset_parse_tz (tz)
 	}
       else if (*tz == '\0')
 	{
-	  /* United States Federal Law, the equivalent of "M4.1.0,M10.5.0".  */
+         /* Daylight time rules in the U.S. are defined in the
+            U.S. Code, Title 15, Chapter 6, Subchapter IX - Standard
+            Time.  These dates were established by Congress in the
+            Energy Policy Act of 2005 [Pub. L. no. 109-58, 119 Stat 594
+            (2005)].  
+	    Below is the equivalent of "M3.2.0,M11.1.0" [/2 not needed
+	    since 2:00AM is the default].  */
 	  tzr->type = M;
 	  if (tzr == &tz_rules[0])
 	    {
-	      tzr->m = 4;
-	      tzr->n = 1;
+	      tzr->m = 3;
+	      tzr->n = 2;
 	      tzr->d = 0;
 	    }
 	  else
 	    {
-	      tzr->m = 10;
-	      tzr->n = 5;
+	      tzr->m = 11;
+	      tzr->n = 1;
 	      tzr->d = 0;
 	    }
 	}

-- 
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]