changeset 2217:98b87d905601

Merge.
author Ziv Scully <ziv@mit.edu>
date Mon, 10 Nov 2014 22:07:51 -0500
parents 70ec9bb337be d77b0665ba7c
children f7113855f3b7
files src/c/urweb.c
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/c/urweb.c	Mon Nov 10 22:04:40 2014 -0500
+++ b/src/c/urweb.c	Mon Nov 10 22:07:51 2014 -0500
@@ -2910,13 +2910,17 @@
     }
   }
   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 @@
     }
   }
   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) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/timeRoundTrip.ur	Mon Nov 10 22:07:51 2014 -0500
@@ -0,0 +1,3 @@
+fun main () : transaction page =
+    t <- now;
+    return <xml>{[readError (show t) : time]}</xml>