Commit b8393e68 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Time zone

parent 3e9dcec3
......@@ -55,6 +55,7 @@ let write_datetime buf (n, s) =
(match s with
| Some s -> Bi_outbuf.add_string buf s
| None ->
let n = Fcalendar.Precise.to_gmt n in
Bi_outbuf.add_string buf (Printer.Precise_Fcalendar.sprint datetime_format n);
let ts = Printf.sprintf "%.6f" (Fcalendar.Precise.to_unixfloat n) in
let i = String.index ts '.' in
......@@ -71,6 +72,7 @@ let datetime_of_json = function
| `String s ->
let i = String.index s '.' in
let l = Printer.Precise_Fcalendar.from_fstring datetime_format (String.sub s 0 i) in
let l = Fcalendar.Precise.from_gmt l in
let r = float_of_string ("0" ^ String.sub s i (String.length s-i)) in
(Fcalendar.Precise.add l (Fcalendar.Precise.Period.second r), Some s)
| _ -> assert false
......
......@@ -25,6 +25,8 @@ let source_file = ref None
let enable_dummy = ref false
let admin_hash = ref ""
let () = CalendarLib.Time_Zone.(change Local)
let () =
let open Ocsigen_extensions.Configuration in
Eliom_config.parse_config [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment