package xapi-stdext-date
Module Xapi_stdext_date.DateSource
date-time with support for keeping timezone for ISO 8601 conversion
Conversions
Convert 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
Convert calendar time x (as returned by e.g. Unix.time), to time in UTC
Convert 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
Convert date/time to an RFC-3339-formatted string. It also complies with the ISO 8601 format
Convert 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
exposed for testing
Count 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
diff a b returns the span of time corresponding to a - b
Deprecated bindings, these will be removed in a future release:
Same as of_unix_time
Same as of_unix_time
Same as to_unix_time
Same as to_rfc3339
Same as of_iso8601