Merge pull request #1051 from Chris00/timegm

Document how to perform the inverse of (gm|local)time
master
Gabriel Scherer 2017-02-22 20:24:15 -05:00 committed by GitHub
commit 12bc55e6eb
1 changed files with 5 additions and 2 deletions

View File

@ -974,11 +974,14 @@ val gettimeofday : unit -> float
val gmtime : float -> tm
(** Convert a time in seconds, as returned by {!Unix.time}, into a date and
a time. Assumes UTC (Coordinated Universal Time), also known as GMT. *)
a time. Assumes UTC (Coordinated Universal Time), also known as GMT.
To perform the inverse conversion, set the TZ environment variable
to "UTC", use {!mktime}, and then restore the original value of TZ. *)
val localtime : float -> tm
(** Convert a time in seconds, as returned by {!Unix.time}, into a date and
a time. Assumes the local time zone. *)
a time. Assumes the local time zone.
The function performing the inverse conversion is {!mktime}. *)
val mktime : tm -> float * tm
(** Convert a date and time, specified by the [tm] argument, into