Basic datemath operation for relative time from string, in clojure based of java time.
Require and use:
(require '[datemath.core :as dm])
(dm/calc "now/w +15d -1s") #_"Return a java.time.ZonedDateTime of the proper date"
(dm/calc "2019-01-02T00:10:30Z||/w +15d -1s") #_"Also support iso zoned date string"
Available operations:
+ add time units- remove time units/ round to/truncate to time unit lower boundaryAvailable units:
s for secondsm for minutesh for hoursd for daysw for weeksM for monthsy for yearsYou should always start with now or an ISO formated with timezone info such as 2019-01-02T00:10:30Z or 2019-01-02T00:10:30+00:00, it will use timezoned date time.
MIT
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs | 
| ← | Move to previous article | 
| → | Move to next article | 
| Ctrl+/ | Jump to the search field |