aboutsummaryrefslogtreecommitdiff
path: root/lib/models/snowflake.ml
diff options
context:
space:
mode:
authorAdelyn Breedlove <[email protected]>2019-01-28 10:31:51 -0700
committerAdelyn Breedlove <[email protected]>2019-01-28 10:31:51 -0700
commit8662e92987c437f59d09896a247ec2b5d82c4528 (patch)
treef004cc14598351d4ad6b19d8e993d2f629c5e738 /lib/models/snowflake.ml
parentAdd more docs (diff)
downloaddisml-8662e92987c437f59d09896a247ec2b5d82c4528.tar.xz
disml-8662e92987c437f59d09896a247ec2b5d82c4528.zip
Publish docs updates
Diffstat (limited to 'lib/models/snowflake.ml')
-rw-r--r--lib/models/snowflake.ml42
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/models/snowflake.ml b/lib/models/snowflake.ml
index 3b55493..44b0a48 100644
--- a/lib/models/snowflake.ml
+++ b/lib/models/snowflake.ml
@@ -1,22 +1,22 @@
-open Core
-
-type t = Int.t [@@deriving sexp]
-
-let of_yojson_exn d = Yojson.Safe.Util.to_string d |> Int.of_string
-
-let of_yojson d =
- try of_yojson_exn d |> Ok
- with Yojson.Safe.Util.Type_error (why,_) -> Error why
-
-let to_yojson s : Yojson.Safe.json = `String (Int.to_string s)
-
-let timestamp snowflake = (snowflake lsr 22) + 1_420_070_400_000
-
-let time_of_t snowflake =
- let t = timestamp snowflake |> float_of_int in
- Time.(Span.of_ms t
- |> of_span_since_epoch)
-
-let timestamp_iso snowflake =
- time_of_t snowflake
+open Core
+
+type t = Int.t [@@deriving sexp]
+
+let of_yojson_exn d = Yojson.Safe.Util.to_string d |> Int.of_string
+
+let of_yojson d =
+ try of_yojson_exn d |> Ok
+ with Yojson.Safe.Util.Type_error (why,_) -> Error why
+
+let to_yojson s : Yojson.Safe.json = `String (Int.to_string s)
+
+let timestamp snowflake = (snowflake lsr 22) + 1_420_070_400_000
+
+let time_of_t snowflake =
+ let t = timestamp snowflake |> float_of_int in
+ Time.(Span.of_ms t
+ |> of_span_since_epoch)
+
+let timestamp_iso snowflake =
+ time_of_t snowflake
|> Time.(to_string_iso8601_basic ~zone:Zone.utc) \ No newline at end of file