Module Gammu.DateTime

Date and time handling.

type t = {
timezone : int;

(** The difference between local time and GMT in seconds *)

second : int;
minute : int;
hour : int;
day : int;
month : int;

(** January = 1, February = 2, etc. *)

year : int;

(** 4 digits year number. *)

}

Date and time type.

val compare : t ‑> t ‑> int

compare d1 d2 returns 0 if d1 is the same date and time as d2, a negative integer if d1 is before d2, and a positive integer if d1 is after d2.

val (=) : t ‑> t ‑> bool

The usual six comparison operators (to benefit from local open, i.e. write Gammu.DateTime.(d1 < d2) instead of Gammu.DateTime.compare d1 d2 < 0.

val (<>) : t ‑> t ‑> bool
val (>) : t ‑> t ‑> bool
val (<) : t ‑> t ‑> bool
val (>=) : t ‑> t ‑> bool
val (<=) : t ‑> t ‑> bool
val check_date : t ‑> bool

Checks whether date is valid. This does not check time, see check_time for this.

val check_time : t ‑> bool

Checks whether time is valid. This does not check date, see check_date for this.

val check : t ‑> bool

Checks whether both date and time are valid (with check_date and check_time).

val os_date : t ‑> string

Converts date from timestamp to string according to OS settings.

val os_date_time : ?⁠timezone:bool ‑> t ‑> string

Converts timestamp to string according to OS settings.