Xapi_stdext_date.DateConversions
val of_ptime : Ptime.t -> tConvert ptime to time in UTC
val to_ptime : t -> Ptime.tConvert date/time to a ptime value: the number of seconds since 00:00:00 UTC, 1 Jan 1970. Assumes the underlying t is in UTC
val of_unix_time : float -> tConvert calendar time x (as returned by e.g. Unix.time), to time in UTC
val to_unix_time : t -> floatConvert date/time to a unix timestamp: the number of seconds since 00:00:00 UTC, 1 Jan 1970. Assumes the underlying t is in UTC
val to_rfc822 : t -> stringConvert date/time to email-formatted (RFC 822) string.
val to_rfc3339 : t -> stringConvert date/time to an RFC-3339-formatted string. It also complies with the ISO 8601 format
val of_iso8601 : string -> tConvert ISO 8601 formatted string to a date/time value. Does not accept a timezone annotated datetime - i.e. string must be UTC, and end with a Z
val epoch : t00:00:00 UTC, 1 Jan 1970, in UTC
val now : unit -> tCount the number of seconds passed since 00:00:00 UTC, 1 Jan 1970, in UTC
val localtime : unit -> tCount the number of seconds passed since 00:00:00 UTC, 1 Jan 1970, in local time
Comparisons
compare a b returns -1 if a is earlier than b, 1 if a is later than b or the ordering of the timezone printer
is_earlier ~than a returns whether the timestamp a happens before than
is_later ~than a returns whether the timestamp a happens after than
Deprecated bindings, these will be removed in a future release:
val rfc822_of_float : float -> tSame as of_unix_time
val of_float : float -> tSame as of_unix_time
val to_float : t -> floatSame as to_unix_time
val to_string : t -> stringSame as to_rfc3339
val of_string : string -> tSame as of_iso8601