Module Date_sig.S.Period

module Period: sig .. end

A period is the number of days between two dates.


Arithmetic operations

type +[< field ] p 
include Period.S

Constructors

val make : int -> int -> int -> Date_sig.S.t

make year month day makes a period of the specified length.

val lmake : ?year:int -> ?month:int -> ?day:int -> unit -> Date_sig.S.t

Labelled version of make. The default value of each argument is 0.

val year : int -> [< Date_sig.S.field > `Year ] period

year n makes a period of n years.

val month : int -> [< Date_sig.S.field > `Month `Year ] period

month n makes a period of n months.

val week : int -> [< Date_sig.S.field > `Day `Week ] period

week n makes a period of n weeks.

val day : int -> [< Date_sig.S.field > `Day `Week ] period

day n makes a period of n days.

Getters

exception Not_computable
val nb_days : [< field ] period -> int
Deprecated. since 2.02: use Date_sig.S.Period.safe_nb_days instead

Number of days in a period.

val safe_nb_days : [< `Day | `Week ] period -> int

Equivalent to Date_sig.S.Period.nb_days but never raises any exception.

val ymd : [< field ] period -> int * int * int

Number of years, months and days in a period.