Skip to content

Commit

Permalink
Fixed datetime printing format. Version 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sagotch committed Feb 22, 2015
1 parent 8e61678 commit 87ff736
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion META
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name ="ISO8601"
version ="0.1.1"
version ="0.1.2"
description ="ISO 8601 and RFC 3339 parsing."
archive(byte) ="ISO8601.cma"
archive(native) ="ISO8601.cmxa"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
LIB=ISO8601
LIB_FILES=$(addprefix $(LIB)., a cmxa cma cmi)
VERSION=0.1.1
VERSION=0.1.2

.INTERMEDIATE: $(LIB).odocl

Expand Down
2 changes: 1 addition & 1 deletion opam
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ opam-version: "1.2"

available: [ ocaml-version >= "3.12.1" ]

version: "0.1.1"
version: "0.1.2"

name: "ISO8601"

Expand Down
4 changes: 2 additions & 2 deletions src/ISO8601.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module Permissive = struct
match tz with
| None -> (t, "")
| Some 0. -> (t, "Z")
| Some x -> (t +. x, Format.sprintf "%2.0f:%2.0f"
| Some x -> (t -. x, Format.sprintf "%2.0f:%2.0f"
(x /. 3600.)
(abs_float (x /. 60.))) in
(Unix.gmtime t, tz)
Expand All @@ -60,7 +60,7 @@ module Permissive = struct
let pp_datetime ?(tz=None) fmt x =
let open Unix in
let (x, tz) = pp_time_tz_aux x tz in
Format.fprintf fmt "%04d%02d-%02dT%02d:%02d:%02d%s"
Format.fprintf fmt "%04d-%02d-%02dT%02d:%02d:%02d%s"
(x.tm_year + 1900) (x.tm_mon + 1) x.tm_mday
x.tm_hour x.tm_min x.tm_sec tz

Expand Down

0 comments on commit 87ff736

Please sign in to comment.