Liking cljdoc? Tell your friends :D

toolbelt.date


<clj

(< date & more)

Returns true if dates are in monotonically increasing order, otherwise false.

Arguments are date instances of any type (e.g. timestamp, java-date, date/time etc.)

Returns true if dates are in monotonically increasing order,
otherwise false.

Arguments are date instances of any type (e.g. timestamp, java-date,
date/time etc.)
sourceraw docstring

<=clj

(<= date & more)

Returns true if dates are in monotonically non-decreasing order, otherwise false.

Arguments are date instances of any type (e.g. timestamp, java-date, date/time etc.)

Returns true if dates are in monotonically non-decreasing order,
otherwise false.

Arguments are date instances of any type (e.g. timestamp, java-date,
date/time etc.)
sourceraw docstring

>clj

(> date & more)

Returns true if dates are in monotonically decreasing order, otherwise false.

Arguments are date instances of any type (e.g. timestamp, java-date, date/time etc.)

Returns true if dates are in monotonically decreasing order,
otherwise false.

Arguments are date instances of any type (e.g. timestamp, java-date,
date/time etc.)
sourceraw docstring

>=clj

(>= date & more)

Returns true if dates are in monotonically non-increasing order, otherwise false.

Arguments are date instances of any type (e.g. timestamp, java-date, date/time etc.)

Returns true if dates are in monotonically non-increasing order,
otherwise false.

Arguments are date instances of any type (e.g. timestamp, java-date,
date/time etc.)
sourceraw docstring

beginning-of-dayclj

(beginning-of-day & args__2042__auto__)

Compatibility alias for start-of-day-local

Compatibility alias for start-of-day-local
sourceraw docstring

beginning-of-monthclj

(beginning-of-month & args__2042__auto__)

Compatibility alias for start-of-month-local

Compatibility alias for start-of-month-local
sourceraw docstring

dayclj

(day date)

Return the day of month component of the given date.

'date' is a date instance of any type (e.g. timestamp, java-date, date/time etc.)

Return the day of month component of the given date.

'date' is a date instance of any type (e.g. timestamp, java-date,
date/time etc.)
sourceraw docstring

daysclj

(days n)

Given a number, returns a Period representing that many days.

Given a number, returns a Period representing that many days.
sourceraw docstring

days-in-monthclj

(days-in-month date)
(days-in-month date timezone)

Takes a date in UTC time and returns the number of days in the month of the local time in timezone the date represents.

Takes a `date` in UTC time and returns the number of days in the month of the local time in `timezone`
the date represents.
sourceraw docstring

defdeprecatedcljmacro

(defdeprecated old new)

Helper macro to def deprecated functions and invoke the new implementation. Taken from leiningen: https://github.com/technomancy/leiningen/commit/6e18fc495d485acb6942d08f3719a644f697bf27

Helper macro to def deprecated functions and invoke the new implementation. Taken from leiningen:
https://github.com/technomancy/leiningen/commit/6e18fc495d485acb6942d08f3719a644f697bf27
sourceraw docstring

end-of-dayclj

(end-of-day & args__2042__auto__)

Compatibility alias for end-of-day-local

Compatibility alias for end-of-day-local
sourceraw docstring

end-of-day-localclj

(end-of-day-local date)
(end-of-day-local date tz)

Given a date in local time UTC, returns a new date representing the time 23:59:59 in timezone 'tz' of the same day. Arity 1: Adjust date to UTC (will be unchanged when input date is in UTC). Arity 2: Adjust date with respect to timezone tz. 'date' is a date instance as per 'toolbelt.date/transform'.

Given a `date` in local time UTC, returns a new date representing the time 23:59:59 in timezone 'tz'
of the same day.
Arity 1: Adjust `date` to UTC (will be unchanged when input date is in UTC).
Arity 2: Adjust `date` with respect to timezone `tz`.
'date' is a date instance as per 'toolbelt.date/transform'.
sourceraw docstring

end-of-day-utcclj

(end-of-day-utc date)
(end-of-day-utc date timezone)
(end-of-day-utc date from-tz to-tz)

Takes a 'date' in UTC time representing a time in 'timezone', and returns a UTC corrected date representing the end of day of the local date in 'timezone'.

Note: Will convert 'date' to local time in 'timezone' before calculating end of day, input should be in UTC. E.g. 'date' represents Oct 12 at 23:00 in Pacific time so the input will be Oct 13 at 06:00. Returned will be Oct 13 at 06:59:59, which represents end of day of Oct 12 in Pacific time 'timezone'. Arity 1: Adjust date from and to UTC timezone. Arity 2: Adjust date from and to the supplied timezone. Arity 3: Adjust date from from-tz and return a new date represented in to-tz.

Takes a 'date' in UTC time representing a time in 'timezone', and returns a UTC corrected date representing the
end of day of the local date in 'timezone'.

Note: Will convert 'date' to local time in 'timezone' before calculating end of day, input should be in UTC.
E.g.
'date' represents Oct 12 at 23:00 in Pacific time so the input will be Oct 13 at 06:00.
Returned will be Oct 13 at 06:59:59, which represents end of day of Oct 12 in Pacific time 'timezone'.
Arity 1: Adjust `date` from and to UTC timezone.
Arity 2: Adjust `date` from and to the supplied `timezone`.
Arity 3: Adjust `date` from `from-tz` and return a new date represented in `to-tz`.
sourceraw docstring

end-of-monthclj

(end-of-month & args__2042__auto__)

Compatibility alias for end-of-month-local

Compatibility alias for end-of-month-local
sourceraw docstring

end-of-month-localclj

(end-of-month-local date)
(end-of-month-local date tz)

Given a date in local time UTC, returns a new date representing the last of the month at 23:59:59 in timezone 'tz' of the same month. Arity 1: Adjust date to UTC (will be unchanged when input date is in UTC). Arity 2: Adjust date with respect to timezone tz. 'date' is a date instance as per 'toolbelt.date/transform'.

Given a `date` in local time UTC, returns a new date representing the last of the month at 23:59:59 in timezone 'tz'
of the same month.
Arity 1: Adjust `date` to UTC (will be unchanged when input date is in UTC).
Arity 2: Adjust `date` with respect to timezone `tz`.
'date' is a date instance as per 'toolbelt.date/transform'.
sourceraw docstring

end-of-month-utcclj

(end-of-month-utc date)
(end-of-month-utc date timezone)
(end-of-month-utc date from-tz to-tz)

Takes a 'date' in UTC time representing a time in 'timezone', and returns the UTC corrected end of the month of the local date in 'timezone'.

Note: Will convert 'date' to local time in 'timezone' before calculating start of month, input should be in UTC. E.g. 'date' represents Oct 31 at 23:00 in Pacific time so the input will be Nov 1 at 06:00. Returned will be Oct 1 at 06:59:59, which represents Oct 31 23:59:59 in Pacific time 'timezone'. Arity 1: Adjust date from and to UTC timezone. Arity 2: Adjust date from and to the supplied timezone. Arity 3: Adjust date from from-tz and return a new date represented in to-tz.

Takes a 'date' in UTC time representing a time in 'timezone', and returns the UTC corrected
end of the month of the local date in 'timezone'.

Note: Will convert 'date' to local time in 'timezone' before calculating start of month, input should be in UTC.
E.g.
'date' represents Oct 31 at 23:00 in Pacific time so the input will be Nov 1 at 06:00.
Returned will be Oct 1 at 06:59:59, which represents Oct 31 23:59:59 in Pacific time 'timezone'.
Arity 1: Adjust `date` from and to UTC timezone.
Arity 2: Adjust `date` from and to the supplied `timezone`.
Arity 3: Adjust `date` from `from-tz` and return a new date represented in `to-tz`.
sourceraw docstring

from-mapclj

(from-map params)

Returns a date given a map with keys and values representing a date time. Considers the following keys: #{:year :month :day :hour :minute :second :millisecond} with corresponding number values when creating the date.

Returns a date given a map with keys and values representing a date time. Considers the following
keys: #{:year :month :day :hour :minute :second :millisecond} with corresponding number values
when creating the date.
sourceraw docstring

from-tz-dateclj

(from-tz-date & args__2042__auto__)

Compatibility alias for tz-uncorrected

Compatibility alias for tz-uncorrected
sourceraw docstring

from-tz-date-timeclj

(from-tz-date-time & args__2042__auto__)

Compatibility alias for tz-uncorrected

Compatibility alias for tz-uncorrected
sourceraw docstring

from-unix-time-millisclj

(from-unix-time-millis millis)

Return a date given the supplied number of millseconds millis since the UNIX time.

Return a date given the supplied number of millseconds `millis` since the UNIX time.
sourceraw docstring

from-unix-time-secsclj

(from-unix-time-secs secs)

Return a date given the supplied number of seconds millis since the UNIX time.

Return a date given the supplied number of seconds `millis` since the UNIX time.
sourceraw docstring

inclj

(in unit p)

Return the interval or period p in unit specified by a keyword: #{:years :months :days :weeks :hours :minutes :seconds :millis}

Return the interval or period `p` in `unit` specified by a keyword:
#{:years :months :days :weeks :hours :minutes :seconds :millis}
sourceraw docstring

in-daysclj

(in-days p)

Return the interval or period in days.

Return the interval or period in days.
sourceraw docstring

in-monthsclj

(in-months p)

Return the interval or period in months.

Return the interval or period in months.
sourceraw docstring

intervalclj

(interval from to)

Returns an interval representing the span between the two given dates. Note that intervals are closed on the left and open on the right.

'from' and 'to' are date instances of any type where 'from' is before 'to'.

Returns an interval representing the span between the two given dates.
Note that intervals are closed on the left and open on the right.

'from' and 'to' are date instances of any type where 'from' is before 'to'.
sourceraw docstring

is-first-day-of-month?clj

(is-first-day-of-month? d)
source

maxclj

(max date & more)

Returns the largest date, i.e. the latest in time.

Returns the largest date, i.e. the latest in time.
sourceraw docstring

minclj

(min date & more)

Returns the smallest date, i.e. the earliest in time.

Returns the smallest date, i.e. the earliest in time.
sourceraw docstring

minusclj

(minus period)
(minus date period)

Transforms a given date and returns a new java.util.Date moved backwards by the given Period(s). Arity 1 version: moved backwards from System/currentTimeMillis.

'date' is a date instance as per 'toolbelt.date/transform'.

Transforms a given date and returns a new java.util.Date moved backwards by the
given Period(s). Arity 1 version: moved backwards from System/currentTimeMillis.

'date' is a date instance as per 'toolbelt.date/transform'.
sourceraw docstring

monthclj

(month date)

Return the month component of the given date.

'date' is a date instance of any type (e.g. timestamp, java-date, date/time etc.)

Return the month component of the given date.

'date' is a date instance of any type (e.g. timestamp, java-date,
date/time etc.)
sourceraw docstring

monthsclj

(months n)

Given a number, returns a Period representing that many months.

Given a number, returns a Period representing that many months.
sourceraw docstring

next-dayclj

(next-day date)
source

next-monthclj

(next-month date)
source

overlapclj

(overlap i1 i2)

Returns an interval representing the overlap between the two supplied intervals.

Returns an interval representing the overlap between the two supplied intervals.
sourceraw docstring

periodclj

(period &
        {:keys [years months days weeks hours minutes seconds millis]
         :as keyvals})

Given some keys with values, returns a Period that represents that amount of time.

E.g. (period :months 2 :days 1) returns a Period representing a time period of 2 months and 2 days.

Possible keys are: #{:years :months :days :weeks :hours :minutes :seconds :millis}

Given some keys with values, returns a Period that represents that amount of time.

E.g. (period :months 2 :days 1) returns a Period representing a time period of
2 months and 2 days.

Possible keys are:
#{:years :months :days :weeks :hours :minutes :seconds :millis}
sourceraw docstring

plusclj

(plus period)
(plus date period)

Transforms a given date and returns a new java.util.Date moved forwards by the given Period(s). Arity 1 version: moved forwards from System/currentTimeMillis.

'date' is a date instance as per 'toolbelt.date/transform'.

Transforms a given date and returns a new java.util.Date moved forwards by the
given Period(s). Arity 1 version: moved forwards from System/currentTimeMillis.

'date' is a date instance as per 'toolbelt.date/transform'.
sourceraw docstring

shortclj

(short date & [include-time])
source

short-dateclj

(short-date & args__2042__auto__)

Compatibility alias for short

Compatibility alias for short
sourceraw docstring

short-date-timeclj

(short-date-time & args__2042__auto__)

Compatibility alias for short

Compatibility alias for short
sourceraw docstring

start-of-day-localclj

(start-of-day-local date)
(start-of-day-local date tz)

Given a date in local time UTC, returns a new date representing the time 00:00:00 in timezone 'tz' of the same day. Arity 1: Adjust date to UTC (will be unchanged when input date is in UTC). Arity 2: Adjust date with respect to timezone tz. 'date' is a date instance as per 'toolbelt.date/transform'.

Given a `date` in local time UTC, returns a new date representing the time 00:00:00 in timezone 'tz'
of the same day.
Arity 1: Adjust `date` to UTC (will be unchanged when input date is in UTC).
Arity 2: Adjust `date` with respect to timezone `tz`.
'date' is a date instance as per 'toolbelt.date/transform'.
sourceraw docstring

start-of-day-utcclj

(start-of-day-utc date)
(start-of-day-utc date timezone)
(start-of-day-utc date from-tz to-tz)

Takes a 'date' in UTC time representing a time in 'timezone', and returns the UTC corrected start of day of the local date in 'timezone'.

Note: Will convert 'date' to local time in 'timezone' before calculating start of day, input should be in UTC. E.g. 'date' represents Oct 12 at 23:00 in Pacific time so the input will be Oct 13 at 06:00. Returned will be Oct 12 at 07:00, which represents start of day of Oct 12 in Pacific time 'timezone'.

Takes a 'date' in UTC time representing a time in 'timezone', and returns the UTC corrected
start of day of the local date in 'timezone'.

Note: Will convert 'date' to local time in 'timezone' before calculating start of day, input should be in UTC.
E.g.
'date' represents Oct 12 at 23:00 in Pacific time so the input will be Oct 13 at 06:00.
Returned will be Oct 12 at 07:00, which represents start of day of Oct 12 in Pacific time 'timezone'.
sourceraw docstring

start-of-month-localclj

(start-of-month-local date)
(start-of-month-local date tz)

Given a date in local time UTC, returns a new date representing the 1st of the month at 00:00:00 in timezone 'tz' of the same month. Arity 1: Adjust date to UTC (will be unchanged when input date is in UTC). Arity 2: Adjust date with respect to timezone tz. 'date' is a date instance as per 'toolbelt.date/transform'.

Given a `date` in local time UTC, returns a new date representing the 1st of the month at 00:00:00 in timezone 'tz'
of the same month.
Arity 1: Adjust `date` to UTC (will be unchanged when input date is in UTC).
Arity 2: Adjust `date` with respect to timezone `tz`.
'date' is a date instance as per 'toolbelt.date/transform'.
sourceraw docstring

start-of-month-utcclj

(start-of-month-utc date)
(start-of-month-utc date timezone)
(start-of-month-utc date from-tz to-tz)

Takes a 'date' in UTC time representing a time in 'timezone', and returns the UTC corrected start of the month of the local date in 'timezone'.

Note: Will convert 'date' to local time in 'timezone' before calculating start of month, input should be in UTC. E.g. 'date' represents Oct 31 at 23:00 in Pacific time so the input will be Nov 1 at 06:00. Returned will be Oct 1 at 07:00, which represents start of Oct in Pacific time 'timezone'.

Takes a 'date' in UTC time representing a time in 'timezone', and returns the UTC corrected
start of the month of the local date in 'timezone'.

Note: Will convert 'date' to local time in 'timezone' before calculating start of month, input should be in UTC.
E.g.
'date' represents Oct 31 at 23:00 in Pacific time so the input will be Nov 1 at 06:00.
Returned will be Oct 1 at 07:00, which represents start of Oct in Pacific time 'timezone'.
sourceraw docstring

to-dateclj

(to-date date)

Coerce to date.

Coerce to date.
sourceraw docstring

to-mapclj

(to-map date)

Returns a map with keys and values representing the supplied date. The returned map includes the following keys: #{:year :month :day :hour :minute :second :millisecond :day-of-week :week-of-year} with corresponding number values.

Returns a map with keys and values representing the supplied `date`. The returned map includes
the following keys: #{:year :month :day :hour :minute :second :millisecond :day-of-week :week-of-year}
with corresponding number values.
sourceraw docstring

to-unix-timeclj

(to-unix-time dt)
(to-unix-time dt unit)

Return the number of seconds after the Unix time Arity 1: returns the number of milliseconds after Unix time. Arity 2: returns the time in unit after Unix time: #{:millis :seconds}

Return the number of seconds after the Unix time
Arity 1: returns the number of milliseconds after Unix time.
Arity 2: returns the time in `unit` after Unix time: #{:millis :seconds}
sourceraw docstring

to-utc-corrected-dateclj

(to-utc-corrected-date & args__2042__auto__)

Compatibility alias for tz-corrected

Compatibility alias for tz-corrected
sourceraw docstring

to-utc-corrected-date-timeclj

(to-utc-corrected-date-time & args__2042__auto__)

Compatibility alias for tz-corrected

Compatibility alias for tz-corrected
sourceraw docstring

transformclj

(transform d f & args)

'Transforms' a date where 'd' is a date of any type (timestamp, org.joda.DateTime, java.util.Date. etc), and returns a java.util.Date, after applying a transformation function 'f', which is a function that takes a date/time instance and any supplied args and returns a date.

'Transforms' a date where 'd' is a date of any type (timestamp,
org.joda.DateTime, java.util.Date. etc), and returns a java.util.Date,
after applying a transformation function 'f', which  is a function
that takes a date/time instance and any supplied args and returns a date.
sourceraw docstring

tz-correctedclj

(tz-corrected inst tz)

Produce the UTC instant in time relative to timezone tz.

Produce the UTC instant in time relative to timezone `tz`.
sourceraw docstring

tz-corrected-dtclj

(tz-corrected-dt dt tz)
source

tz-uncorrectedclj

(tz-uncorrected inst tz)

Produce the absolute UTC instant from timezone tz.

Produce the absolute UTC instant from timezone `tz`.
sourceraw docstring

tz-uncorrected-dtclj

(tz-uncorrected-dt dt tz)
source

within?clj

(within? interval test)
(within? start end test)

With 2 arguments: Returns true if the given Interval contains the given date. Note that if the date is exactly equal to the end of the interval, this function returns false. With 3 arguments: Returns true if the start date is equal to or before and the end date is equal to or after the test ReadablePartial.

With 2 arguments: Returns true if the given Interval contains the given
date. Note that if the date is exactly equal to the
end of the interval, this function returns false.
With 3 arguments: Returns true if the start date is
equal to or before and the end date is equal to or after the test
ReadablePartial.
sourceraw docstring

yearclj

(year date)

Return the year component of the given date.

'date' is a date instance of any type (e.g. timestamp, java-date, date/time etc.)

Return the year component of the given date.

'date' is a date instance of any type (e.g. timestamp, java-date,
date/time etc.)
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close