Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Lunar.Duration
Describes a duration in seconds (Lunar is essentially a Calendar library, so greater precision does not seem particularly useful). This is the most primitive type in the library, and the API exposes minimal set of arithmetic operations.
Type
A duration is an abstract representation of Int64.t.
from_days i converts the given int i into a duration. from_days 1 = from_seconds 86400
val from_datetime :
year:int ->month:int ->day:int ->hour:int ->min:int ->sec:int ->t
from_datetime ~year ~month ~day ~hour ~min ~sec builds a duration based on a date. Duration is the number of seconds that have elapsed since January 1, 1970, at 00:00:00.
Warning: The function is generally lax, performing no checks on input arguments, and is mainly used internally.
Conversion
val to_datetime : t-> int * int * int * int * int * int
to_datetime d returns an approximation of the date calculated based on the number of seconds elapsed since January 1, 1970, at 00:00:00. The return value is in the form of the following tuple: year * month * day_of_month * hour * minute * second.