Time.Period
A period is the number of seconds between two times.
include Period.S
type +'a period constraint 'a = [< Period.date_field ]
type t = Period.date_field period
Type of a period.
val empty : 'a period
The empty period.
val hash : 'a period -> int
Hash function for periods.
make hour minute second
makes a period of the specified length.
Labelled version of make
. The default value is 0
for each argument.
val hour : int -> 'a period
hour n
makes a period of n
hours.
val minute : int -> 'a period
minute n
makes a period of n
minutes.
Number of seconds of a period. @example to_seconds (make 1 2 3)
returns 3600 + 120 + 3 = 3723
.
val to_minutes : 'a period -> float
Number of minutes of a period. The resulting fractional part represents seconds. @example to_minutes (make 1 2 3)
returns 60 + 2 + 0.05 = 62.05
.
val to_hours : 'a period -> float
Number of hours of a period. The resulting fractional part represents minutes and seconds. @example to_hours (make 1 3 0)
returns 1 + 0.05 = 1.05
.