Module Time_sig.S.Period


module Period: sig .. end
A period is the number of seconds between two times.


Arithmetic operations


include Period.S
val length : [< Period.date_field ] period -> Time_sig.S.second
Number of seconds of a period.
val mul : ([< Period.date_field ] as 'a) period -> 'a period -> 'a period
Multiplication.
val div : ([< Period.date_field ] as 'a) period -> 'a period -> 'a period
Division.

Constructors


val make : int -> int -> Time_sig.S.second -> [< Period.date_field ] period
make hour minute second makes a period of the specified length.
val lmake : ?hour:int ->
?minute:int ->
?second:Time_sig.S.second -> unit -> [< Period.date_field ] period
Labelled version of make. The default value is 0 for each argument.
val hour : int -> [< Period.date_field ] period
hour n makes a period of n hours.
val minute : int -> [< Period.date_field ] period
minute n makes a period of n minutes.
val second : Time_sig.S.second -> [< Period.date_field ] period
second n makes a period of n seconds.

Getters


val to_seconds : [< Period.date_field ] period -> Time_sig.S.second
Number of seconds of a period.
Since 1.04
Example: to_seconds (make 1 2 3) returns 3600 + 120 + 3 = 3723.
val to_minutes : [< Period.date_field ] period -> float
Number of minutes of a period. The resulting fractional part represents seconds.
Since 1.04
Example: to_minutes (make 1 2 3) returns 60 + 2 + 0.05 = 62.05.
val to_hours : [< Period.date_field ] period -> float
Number of hours of a period. The resulting fractional part represents minutes and seconds.
Since 1.04
Example: to_hours (make 1 3 0) returns 1 + 0.05 = 1.05.