diff src/c/urweb.c @ 1439:6ff10428de4a

Fix 'readUtc' to work during DST
author Adam Chlipala <adam@chlipala.net>
date Fri, 18 Mar 2011 21:01:10 -0400
parents 4a6f84092399
children 0fc7b676b88b
line wrap: on
line diff
--- a/src/c/urweb.c	Fri Mar 18 09:46:24 2011 -0400
+++ b/src/c/urweb.c	Fri Mar 18 21:01:10 2011 -0400
@@ -3736,6 +3736,12 @@
     r->seconds = mktime(&stm);
     r->microseconds = 0;
 
+    localtime_r(&r->seconds, &stm);
+    if (stm.tm_isdst == 1) {
+      ++stm.tm_hour;
+      r->seconds = mktime(&stm);
+    }
+
     return r;
   }
   else