JeffBezanson/femtolisp

parsetime should initialize timezone

dcurrie opened this issue · 1 comments

Bug:

> (time.string (time.fromstring "Mon Nov 14 20:37:36 2016"))
"Mon Nov 14 19:37:36 2016"

I fixed this in my copy of timefuncs.c with:

--- llt/timefuncs.c
+++ llt/timefuncs.c
@@ -116,10 +116,12 @@
     time_t t;
     struct tm tm;
 
     res = strptime(str, fmt, &tm);
     if (res != NULL) {
+        tm.tm_isdst = -1; /* Not set by strptime(); tells mktime() to determine
+                            whether daylight saving time is in effect */
         t = mktime(&tm);
         if (t == ((time_t)-1))
             return -1;
         return (double)t;
     }

Could you make a PR for this?