diff src/c/urweb.c @ 1372:268d9af9103f

Basis.readUtc
author Adam Chlipala <adam@chlipala.net>
date Tue, 28 Dec 2010 14:51:57 -0500
parents 44a12a321150
children 04bd0d91b74c
line wrap: on
line diff
--- a/src/c/urweb.c	Mon Dec 27 12:08:00 2010 -0500
+++ b/src/c/urweb.c	Tue Dec 28 14:51:57 2010 -0500
@@ -3661,3 +3661,14 @@
   return !!(uw_Basis_eq_time(ctx, t1, t2) || uw_Basis_lt_time(ctx, t1, t2));
 }
 
+uw_Basis_time *uw_Basis_readUtc(uw_context ctx, uw_Basis_string s) {
+  uw_Basis_time *r = uw_Basis_stringToTime(ctx, s);
+
+  if (r) {
+    struct tm tm;
+    localtime_r(&r->seconds, &tm);
+    r->seconds -= tm.tm_gmtoff;
+  }
+
+  return r;
+}