diff options
author | 2010-12-28 14:51:57 -0500 | |
---|---|---|
committer | 2010-12-28 14:51:57 -0500 | |
commit | c3a91028d8cb4c5e47996cf5baf55778769acb75 (patch) | |
tree | 6df5ed722eb232892944a12fa51429f0f6801447 /src | |
parent | 5cab93a0031e80264226f44ff986c62b65b03c5e (diff) |
Basis.readUtc
Diffstat (limited to 'src')
-rw-r--r-- | src/c/urweb.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index b78c4c82..2858fefc 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -3661,3 +3661,14 @@ uw_Basis_bool uw_Basis_le_time(uw_context ctx, uw_Basis_time t1, uw_Basis_time t 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; +} |