Date
Returns number of days for the given month and year for gregorian calendar. Takes into account leap years.
time_elapsed start stop
Compute the time elapsed between start
and stop
. If stop
is prior to start
, resulting dmy
's field are negative (but correct). Resulting prec
can be:
Sure
for exact durationBefore
for "less than" durationAfter
for "more than" durationMaybe
for other cases Used to compare only gregorian calendar's dates.Same as time_elapsed
, but will return None
if computation is not possible (e.g. time_elapsed_opt /1839 /1859).
dmy_of_dmy2 dmy2
Convert a dmy2
to dmy
using Sure
as precision.
Not_comparable
is raised by compare_dmy
and compare_date
when strict
mode is used and precision of dates are incompatibles to have a reliable result (e.g. is compare_dmy 2019 07/2019
) or when one of the date in compare_date
is Dtext
.
compare_dmy ?strict d1 d2
Return a negative integer if d1
is prior to d2
, 0
if d1
is equal to d2
, and a positive integer if d2
is prior to d1
. strict
parameter enable or disable strict mode, and is false by default (see Not_comparable
)
compare_dmy_opt ?strict d1 d2
Same as compare_dmy
, but do not raise an exception
compare_date d1 d2
If both d1
and d2
are Dgreg
date, uses compare_dmy
to compare them. Dtext
dates are always considered prior to any Dgreg
date, and equal to any other Dtext
date. strict
parameter enable or disable strict mode, and is false by default (see Not_comparable
)
val cdate_None : Def.cdate
Absent compressed date
cdate_to_dmy_opt d
is Some dmy
iff d
resolve to Dgreg (dmy,_)