package gammu

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Date and time handling.

type t = {
  1. timezone : int;
    (*

    The difference between local time and GMT in seconds

    *)
  2. second : int;
  3. minute : int;
  4. hour : int;
  5. day : int;
  6. month : int;
    (*

    January = 1, February = 2, etc.

    *)
  7. 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.

  • parameter timezone

    Whether to include time zone (default false).