package odate

  1. Overview
  2. Docs
type tm = {
  1. tm_sec : int;
    (*

    Seconds 0..60

    *)
  2. tm_min : int;
    (*

    Minutes 0..59

    *)
  3. tm_hour : int;
    (*

    Hours 0..23

    *)
  4. tm_mday : int;
    (*

    Day of month 1..31

    *)
  5. tm_mon : int;
    (*

    Month of year 0..11

    *)
  6. tm_year : int;
    (*

    Year - 1900

    *)
  7. tm_wday : int;
    (*

    Day of week (Sunday is 0)

    *)
  8. tm_yday : int;
    (*

    Day of year 0..365

    *)
  9. tm_isdst : bool;
    (*

    Daylight time savings in effect

    *)
}

Clock operations. Currently read-only to retrieve the time in various formats.

The type representing wallclock time and calendar date.

val time : unit -> float

Return the current time since 00:00:00 GMT, Jan. 1, 1970, in seconds.

val gettimeofday : unit -> float

Same as time, but with resolution better than 1 second.

val gmtime : float -> tm

Convert a time in seconds, as returned by time, into a date and a time. Assumes UTC (Coordinated Universal Time), also known as GMT.

val localtime : float -> tm

Convert a time in seconds, as returned by time, into a date and a time. Assumes UTC (Coordinated Universal Time), also known as GMT.

Convert a time in seconds, as returned by Unix.time, into a date and a time. Assumes the local time zone.

val mktime : tm -> float * tm

Convert a date and time, specified by the tm argument, into a time in seconds, as returned by Unix.time. The tm_isdst, tm_wday and tm_yday fields of tm are ignored. Also return a normalized copy of the given tm record, with the tm_wday, tm_yday, and tm_isdst fields recomputed from the other fields, and the other fields normalized (so that, e.g., 40 October is changed into 9 November). The tm argument is interpreted in the local time zone.

OCaml

Innovation. Community. Security.