diff options
author | Ziv Scully <ziv@mit.edu> | 2014-11-10 22:07:51 -0500 |
---|---|---|
committer | Ziv Scully <ziv@mit.edu> | 2014-11-10 22:07:51 -0500 |
commit | 1b27dccf5a92bf74b247c957d3760c7d0958d78a (patch) | |
tree | 8a3aac2e8c2909a395dea752f8def840bad18175 /src | |
parent | dc5e7102563b9c0714391f86b6dcf852445ee192 (diff) | |
parent | a167f651f6a12eab4772ab3cb16b63633e8c77ae (diff) |
Merge.
Diffstat (limited to 'src')
-rw-r--r-- | src/c/urweb.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index 51ce2735..8ecef7c5 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -2910,13 +2910,17 @@ uw_Basis_time *uw_Basis_stringToTime(uw_context ctx, uw_Basis_string s) { } } else { - if (strptime(s, TIME_FMT_PG, &stm) == end) { + if (strptime(s, ctx->app->time_format, &stm) == end) { uw_Basis_time *r = uw_malloc(ctx, sizeof(uw_Basis_time)); r->seconds = mktime(&stm); r->microseconds = 0; return r; - } - else if (strptime(s, TIME_FMT, &stm) == end) { + } else if (strptime(s, TIME_FMT_PG, &stm) == end) { + uw_Basis_time *r = uw_malloc(ctx, sizeof(uw_Basis_time)); + r->seconds = mktime(&stm); + r->microseconds = 0; + return r; + } else if (strptime(s, TIME_FMT, &stm) == end) { uw_Basis_time *r = uw_malloc(ctx, sizeof(uw_Basis_time)); r->seconds = mktime(&stm); r->microseconds = 0; @@ -3060,7 +3064,10 @@ uw_Basis_time uw_Basis_stringToTime_error(uw_context ctx, uw_Basis_string s) { } } else { - if (strptime(s, TIME_FMT_PG, &stm) == end) { + if (strptime(s, ctx->app->time_format, &stm) == end) { + uw_Basis_time r = { mktime(&stm) }; + return r; + } else if (strptime(s, TIME_FMT_PG, &stm) == end) { uw_Basis_time r = { mktime(&stm) }; return r; } else if (strptime(s, TIME_FMT, &stm) == end) { |