aboutsummaryrefslogtreecommitdiff
path: root/lib/models/snowflake.mli
blob: 1f3622ccf3ce1c49b371cd1ba4809d8b89e529f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
type t = Base.Int.t [@@deriving sexp, yojson { exn = true }]

(** Convert a snowflake into a {!Core.Time.t} *)
(* val time_of_t : t -> Time.t *)

(** Convert a snowflake into a Unix timestamp. Millisecond precision. *)
val timestamp : t -> int

(** Convert a snowflake into an ISO8601 timestamp string. This is equivalent to calling [Snowflake.time_of_t snowflake |> Time.(to_string_iso8601_basic ~zone:Zone.utc)] *)
(* val timestamp_iso : t -> string *)