]> granicus.if.org Git - jq/commitdiff
Make UTC time on Windows
authorJason Hood <jadoxa@yahoo.com.au>
Thu, 14 Feb 2019 08:42:51 +0000 (18:42 +1000)
committerNico Williams <nico@cryptonector.com>
Sun, 17 Feb 2019 02:42:25 +0000 (20:42 -0600)
Windows has `_mkgmtime` for the UTC equivalent of `mktime`.

src/builtin.c

index 3cde61a37dc9717d9f3bfef71f223eaecdc602ec..eb2cd876b11d9c29effc8a7ae7b8433e69fd7121 100644 (file)
@@ -1238,6 +1238,8 @@ static time_t my_mktime(struct tm *tm) {
   if (t == (time_t)-1)
     return t;
   return t + tm->__tm_gmtoff;
+#elif WIN32
+  return _mkgmtime(tm);
 #else
   char *tz;