module Date: sig
.. end
String conversions
type
t = private {
}
val bin_size_t : binable Bin_prot.Size.sizer
val bin_write_t : binable Bin_prot.Map_to_safe.writer
val bin_write_t_ : binable Bin_prot.Unsafe_write_c.writer
val bin_writer_t : binable Bin_prot.Type_class.writer
val bin_read_t : binable Bin_prot.Read_ml.reader
val bin_read_t_ : binable Bin_prot.Unsafe_read_c.reader
val bin_read_t__ : (int -> binable) Bin_prot.Unsafe_read_c.reader
val bin_reader_t : binable Bin_prot.Type_class.reader
val bin_t : binable Bin_prot.Type_class.t
val sexp_of_t : sexpable -> Sexplib.Sexp.t
val t_of_sexp : Sexplib.Sexp.t -> sexpable
include Sexpable
include Binable
include Hashable_binable
include Stringable
converts a string to a date, in formats:
m/d/y
y-m-d (* valid iso8601_extended *)
DD MMM YYYY
DDMMMYYYY
YYYYMMDD
include Comparable
val sexp_of_t_style : [ `Atom_yyyy_mm_dd | `List_ymd ] Pervasives.ref
sexp_of_t_style
controls how sexp_of_t
works
sexp_ot_t_style sexp
---------------- -----------------------
`List_ymd ((y 2008) (m 4) (d 29))
`Atom_yyyy_mm_dd 2008-04-29
val create : y:int -> m:Month.t -> d:int -> t
val of_tm : Unix.tm -> t
val to_string_iso8601_extended : t -> string
val to_string_iso8601_basic : t -> string
val to_string_old : t -> string
val min_value : t
val max_value : t
val pp : Format.formatter -> t -> unit
val day : t -> int
val month : t -> Month.t
val year : t -> int
val today : unit -> t
val day_of_week : t -> Weekday.t
val is_weekday : t -> bool
val is_business_day : t -> is_holiday:(t -> bool) -> bool
val add_days : t -> int -> t
val diff : t -> t -> int
diff t1 t2
returns date t1
minus date t2
in days.
val add_weekdays : t -> int -> t
add_weekdays t n
returns t when n=0 even if t is not a weekday
val add_business_days : t -> is_holiday:(t -> bool) -> int -> t
add_business_days t ~is_holiday n
returns t when n=0 even if t is not
a business day. add_business_days ~is_holiday:(fun _ -> false) ...
is the
same as add_weekdays
.
val dates_between : min:t -> max:t -> t list
val business_dates_between : min:t ->
max:t -> is_holiday:(t -> bool) -> t list
val weekdays_between : min:t -> max:t -> t list
val previous_weekday : t -> t