dates_calc
Dates_calc.Dates
type date
A valid date in the standard Gregorian calendar.
type period
A period can be any number and combination of days, months, years.
exception InvalidDate
exception AmbiguousComputation
type date_rounding =
| RoundUp
| RoundDown
| AbortOnRound
When choosing AbortOnRound, functions may raise AmbiguousComputation.
AbortOnRound
AmbiguousComputation
val make_date : year:int -> month:int -> day:int -> date
[InvalidDate]
val add_dates : ?round:date_rounding -> date -> period -> date
[AmbiguousComputation]
val sub_dates : date -> date -> period
The returned period is always expressed as a number of days.
period
val compare_dates : date -> date -> int
val date_to_ymd : date -> int * int * int
val format_date : Format.formatter -> date -> unit
Respects ISO8601 format.
val date_of_string : string -> date
val first_day_of_month : date -> date
val last_day_of_month : date -> date
val is_leap_year : int -> bool
val make_period : years:int -> months:int -> days:int -> period
val neg_period : period -> period
val add_periods : period -> period -> period
val sub_periods : period -> period -> period
val mul_period : period -> int -> period
val format_period : Format.formatter -> period -> unit
val period_of_string : string -> period
val period_to_days : period -> int
when the period is anything else than a number of days.
val period_to_ymds : period -> int * int * int