include Core__.Core_date_intf.Core_dateinclude module type of Core__.Core_date_intf.Date with type Date.t := tDate module.
include sig ... endval bin_t : t Bin_prot.Type_class.tval bin_read_t : t Bin_prot.Read.readerval __bin_read_t__ : (Core_kernel__.Import.int ‑> t) Bin_prot.Read.readerval bin_reader_t : t Bin_prot.Type_class.readerval bin_size_t : t Bin_prot.Size.sizerval bin_write_t : t Bin_prot.Write.writerval bin_writer_t : t Bin_prot.Type_class.writerval bin_shape_t : Bin_prot.Shape.tval hash_fold_t : Base.Hash.state ‑> t ‑> Base.Hash.stateval hash : t ‑> Base.Hash.hash_valueval t_of_sexp : Base.Sexp.t ‑> tval sexp_of_t : t ‑> Base.Sexp.tinclude Core_kernel__.Std_internal.Hashable_binable with type t := tinclude sig ... endval hash_fold_t : Base.Hash.state ‑> t ‑> Base.Hash.stateval hash : t ‑> Base.Hash.hash_valueval hashable : t Core_kernel.Hashtbl.Hashable.tmodule Table : Core_kernel.Hashtbl.S_binable with type key = tmodule Hash_set : Core_kernel.Hash_set.S_binable with type elt = tmodule Hash_queue : Core_kernel.Hash_queue.S with type Key.t = tconverts a string to a date in the following formats:
include Core_kernel__.Std_internal.Stringable with type t := tval of_string : string ‑> tval to_string : t ‑> stringinclude Core_kernel__.Std_internal.Comparable_binable with type t := tinclude Core_kernel__.Comparable_intf.S_commoninclude Base.Comparable.Sinclude Base__.Comparable_intf.Polymorphic_compareascending is identical to compare. descending x y = ascending y x. These are
intended to be mnemonic when used like List.sort ~compare:ascending and List.sort
~cmp:descending, since they cause the list to be sorted in ascending or descending
order, respectively.
clamp_exn t ~min ~max returns t', the closest value to t such that
between t' ~low:min ~high:max is true.
Raises if not (min <= max).
val clamp : t ‑> min:t ‑> max:t ‑> t Base.Or_error.tinclude Base.Comparator.S with type t := tval comparator : (t, comparator_witness) Base.Comparator.comparatorinclude Base__.Comparable_intf.Validate with type t := tval validate_lbound : min:t Base.Maybe_bound.t ‑> t Base.Validate.checkval validate_ubound : max:t Base.Maybe_bound.t ‑> t Base.Validate.checkval validate_bound : min:t Base.Maybe_bound.t ‑> max:t Base.Maybe_bound.t ‑> t Base.Validate.checkmodule Replace_polymorphic_compare : Core_kernel__.Comparable_intf.Polymorphic_compare with type t := tinclude Core_kernel__.Comparable_intf.Map_and_set_binable with type t := t with type comparator_witness := comparator_witnessinclude Core_kernel.Comparator.S with type t := tval comparator : (t, comparator_witness) Core_kernel.Comparator.comparatormodule Map : Core_kernel.Map.S_binable with type Key.t = t with type Key.comparator_witness = comparator_witnessmodule Set : Core_kernel.Set.S_binable with type Elt.t = t with type Elt.comparator_witness = comparator_witnessinclude Core_kernel__.Import.Pretty_printer.S with type t := tval pp : Base.Formatter.t ‑> t ‑> unitval create_exn : y:Core_kernel__.Import.int ‑> m:Core_kernel.Month.t ‑> d:Core_kernel__.Import.int ‑> tcreate_exn ~y ~m ~d creates the date specified in the arguments. Arguments are
validated, and are not normalized in any way. So, days must be within the limits
for the month in question, numbers cannot be negative, years must be fully
specified, etc.
val of_string_iso8601_basic : Core_kernel__.Import.string ‑> pos:Core_kernel__.Import.int ‑> tFor details on this ISO format, see:
http://www.wikipedia.org/wiki/iso8601
YYYYMMDD
val day : t ‑> Core_kernel__.Import.intval month : t ‑> Core_kernel.Month.tval year : t ‑> Core_kernel__.Import.intval day_of_week : t ‑> Core_kernel.Day_of_week.tval week_number : t ‑> Core_kernel__.Import.intWeek of the year, from 1 to 53. According to ISO 8601, weeks start on Monday, and the first week of a year is the week that contains the first Thursday of the year. Notice that this means that dates near the end of the year can have week number 1, and dates near the beginning of the year can have week number 52 or 53.
Warning: the triple (year, week number, week day) does not identify a date -- e.g. 2012-01-02 and 2012-12-31 are both Mondays of week 1. (However, if instead of the year, you use the year of the nearest Thursday, then it does work.)
val is_weekend : t ‑> Core_kernel__.Import.boolval is_weekday : t ‑> Core_kernel__.Import.boolval is_business_day : t ‑> is_holiday:(t ‑> Core_kernel__.Import.bool) ‑> Core_kernel__.Import.boolMonday through Friday are business days, unless they're a holiday.
val add_days : t ‑> Core_kernel__.Import.int ‑> tadd_days t n adds n days to t and returns the resulting date.
val add_months : t ‑> Core_kernel__.Import.int ‑> tadd_months t n returns date with max days for the month if the date would be
invalid. e.g. adding 1 month to Jan 30 results in Feb 28 due to Feb 30 being
an invalid date, Feb 29 is returned in cases of leap year.
In particular, this means adding x months and then adding y months isn't the
same as adding x + y months, and in particular adding x months and then -x
months won't always get you back where you were. *
val add_years : t ‑> Core_kernel__.Import.int ‑> tadd_years t n has the same semantics as add_months for adding years to Feb 29 of
a leap year, i.e., when the addition results in a date in a non-leap year, the
result will be Feb 28 of that year.
val diff_weekdays : t ‑> t ‑> Core_kernel__.Import.intdiff_weekdays t1 t2 returns the number of weekdays in the half-open interval
[t2,t1) if t1 >= t2, and - diff_weekdays t2 t1 otherwise.
val diff_weekend_days : t ‑> t ‑> Core_kernel__.Import.intdiff_weekend_days t1 t2 returns the number of days that are weekend days in the
half-open interval [t2,t1) if t1 >= t2, and - diff_weekend_days t2 t1 otherwise.
val add_weekdays : t ‑> Core_kernel__.Import.int ‑> tadd_weekdays t 0 returns the next weekday if t is a weekend and t otherwise.
Unlike add_days this is done by looping over the count of days to be added (forward or
backwards based on the sign), and is O(n) in the number of days to add.
Beware, add_weekdays sat 1 or add_weekdays sun 1 both return the next tue,
not the next mon. You may want to use following_weekday if you want the next
following weekday, following_weekday (fri|sat|sun) would all return the next mon.
val add_business_days : t ‑> is_holiday:(t ‑> Core_kernel__.Import.bool) ‑> Core_kernel__.Import.int ‑> tadd_business_days t ~is_holiday n returns a business day even when
n=0. add_business_days ~is_holiday:(fun _ -> false) ... is the same as
add_weekdays.
If you don't want to skip Saturday or Sunday, use add_days_skipping.
val add_days_skipping : t ‑> skip:(t ‑> Core_kernel__.Import.bool) ‑> Core_kernel__.Import.int ‑> tadd_days_skipping t ~skip n adds n days to t, ignoring any date satisfying
skip, starting at the first date at or after t that does not satisfy skip.
For example, if skip t = true, then add_days_skipping t ~skip 0 > t.
add_business_days and add_weekdays are special cases of add_days_skipping.
val dates_between : min:t ‑> max:t ‑> t Core_kernel__.Import.listthe following returns a closed interval (endpoints included)
val business_dates_between : min:t ‑> max:t ‑> is_holiday:(t ‑> Core_kernel__.Import.bool) ‑> t Core_kernel__.Import.listval weekdays_between : min:t ‑> max:t ‑> t Core_kernel__.Import.listval first_strictly_after : t ‑> on:Core_kernel.Day_of_week.t ‑> tfirst_strictly_after t ~on:day_of_week returns the first occurrence of day_of_week
strictly after t.
val is_leap_year : year:Core_kernel__.Import.int ‑> Core_kernel__.Import.boolis_leap_year ~year returns true if year is considered a leap year
gen generates dates between 1900-01-01 and 2100-01-01.
val gen_incl : t ‑> t ‑> t Core_kernel.Quickcheck.Generator.tgen_incl d1 d2 generates dates in the range between d1 and d2, inclusive, with
the endpoints having higher weight than the rest. Raises if d1 > d2.
val gen_uniform_incl : t ‑> t ‑> t Core_kernel.Quickcheck.Generator.tgen_uniform_incl d1 d2 generates dates chosen uniformly in the range between d1
and d2, inclusive. Raises if d1 > d2.
Days provides a linear representation of dates that is optimized for arithmetic on
the number of days between dates, rather than for representing year/month/day
components. This module is intended for use only in performance-sensitive contexts
where dates are manipulated more often than they are constructed or deconstructed;
most clients should use the ordinary t.
module Stable : sig ... endmodule O : sig ... endval of_time : Core_kernel__.Time_float.t ‑> zone:Core_kernel__.Time_float.Zone.t ‑> tval today : zone:Core_kernel__.Time_float.Zone.t ‑> tval format : t ‑> string ‑> stringThis formats a date using the format patterns available in strftime.
val parse : fmt:string ‑> string ‑> tThis parses a date using the format patterns available in strptime.
val of_tm : Core__.Core_unix.tm ‑> t