Liking cljdoc? Tell your friends :D

duckling.time.obj


->fieldsclj

(->fields {:keys [start] :as t})
source

add-to-periodclj

(add-to-period p grain n)

Adds the given quantity of grain to the period

Adds the given quantity of grain to the period
sourceraw docstring

before?clj

(before? t1 t2)
source

dayclj

(day t)
source

day-of-weekclj

(day-of-week t)
source

days-in-monthclj

(days-in-month tt)
source

endclj

(end {:keys [start grain end] :as t})

Returns the end instant of the time object

Returns the end *instant* of the time object
sourceraw docstring

grain-orderclj

source

hourclj

(hour t)
source

intersectclj

(intersect t1 t2)

With the special case of time grains, it's quite easy. Will need to generalize to intervals later. Returns nil if no intersection. The result grain is the smallest of the args grains.

With the special case of time grains, it's quite easy. Will need to generalize to
intervals later. Returns nil if no intersection.
The result grain is the smallest of the args grains.
sourceraw docstring

intervalclj

(interval t1 t2)

Builds a time interval between start of t1 and start of t2. The grain is the smallest of the args.

Builds a time interval between start of t1 and *start* of t2.
The grain is the smallest of the args.
sourceraw docstring

interval-start-endclj

(interval-start-end t1 t2)

Builds a time interval between start of t1 and end of t2. The grain is the smallest of the args.

Builds a time interval between start of t1 and *end* of t2.
The grain is the smallest of the args.
sourceraw docstring

minusclj

(minus tt grain n)
source

minuteclj

(minute t)
source

monthclj

(month t)
source

negative-periodclj

(negative-period period)

Turn a period into its opposite sign

Turn a period into its opposite sign
sourceraw docstring

nowclj

(now)
source

periodclj

(period grain n)

Creates a period object with the given grain and quantity (can be negative)

Creates a period object with the given grain and quantity (can be negative)
sourceraw docstring

period->durationclj

(period->duration period)

Convert a period into an amount of seconds. This is approximate, since for instance 1 month's duration in seconds depends on which month

Convert a period into an amount of seconds. This is approximate, since for
instance 1 month's duration in seconds depends on which month
sourceraw docstring

period-fieldsclj

source

period-grainclj

(period-grain period)

Returns the grain of the period (the finest of its grains)

Returns the grain of the period (the finest of its grains)
sourceraw docstring

plusclj

(plus tt grain n)

Add n grain to tt. Set the grain to the finest between tt's and the added one.

Add n grain to tt.
Set the grain to the finest between tt's and the added one.
sourceraw docstring

plus-periodclj

(plus-period tt period)

Adds the period to the time object. The resulting grain is the finest.

Adds the period to the time object. The resulting grain is the finest.
sourceraw docstring

roundclj

(round tt grain)

Rounds the time grain to the grain: all smaller grain fields set to 0. If applied to a true interval (with :end), it turns the interval into a grain time objects (rounds start, removes :end).

Rounds the time grain to the grain: all smaller grain fields set to 0.
If applied to a true interval (with :end), it turns the interval into
a grain time objects (rounds start, removes :end).
sourceraw docstring

secclj

(sec t)
source

start-before-the-end-of?clj

(start-before-the-end-of? t1 t2)
source

starting-at-the-end-ofclj

(starting-at-the-end-of tt)

Build a time that starts at the end of provided time, with same grain

Build a time that starts at the end of provided time, with same grain
sourceraw docstring

tclj

(t timezone year)
(t timezone year month)
(t timezone year month day)
(t timezone year month day hour)
(t timezone year month day hour minute)
(t timezone year month day hour minute second)
(t grain timezone year month day hour minute second)

Builds a time object with timezone, start and grain. Timezone is actually extracted from the provided instant.

Builds a time object with timezone, start and grain.
Timezone is actually extracted from the provided instant.
sourceraw docstring

time-fieldsclj

source

valid?clj

(valid? {:keys [start grain end] :as t})
source

yearclj

(year t)
source

zoneclj

(zone timezone)
source

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

× close