(after? a b)Returns true if instant a is after instant b.
Returns true if instant a is after instant b.
(before? a b)Returns true if instant a is before instant b.
Returns true if instant a is before instant b.
(between? instant start end)Returns true if instant is within [start, end] inclusive.
Returns true if instant is within [start, end] inclusive.
(compare-instants a b)Compares two instants (or maps/epoch values). Returns -1, 0, or 1.
Compares two instants (or maps/epoch values). Returns -1, 0, or 1.
(duration value)(duration amount unit)Creates a Duration. Accepts a map like {:seconds 1 :millis 250}, a Duration instance, or an amount + unit.
Creates a Duration. Accepts a map like {:seconds 1 :millis 250},
a Duration instance, or an amount + unit.(duration->map d)Converts a Duration to a map with a :millis key.
Converts a Duration to a map with a :millis key.
(instant->map inst)(instant->map inst zone)Converts an Instant into a time map.
The map uses {:epoch-ms <long>} and optionally a :zone string.
Converts an Instant into a time map.
The map uses {:epoch-ms <long>} and optionally a :zone string.(instant-map? value)Returns true if the value looks like an instant map.
Supported shapes:
Returns true if the value looks like an instant map.
Supported shapes:
- {:epoch-ms <long>}
- {:epoch-second <long> :nano <int>}(instant= a b)Returns true if both instants represent the same moment.
Returns true if both instants represent the same moment.
(instant? value)Returns true if the value is a java.time.Instant.
Returns true if the value is a java.time.Instant.
(map->instant m)Converts a time map into an Instant.
Converts a time map into an Instant.
(minus value dur)(minus value unit amount)Subtracts a duration from a Clock, Instant, or time map.
Subtracts a duration from a Clock, Instant, or time map.
(new-clock)(new-clock {:keys [type zone instant clock offset tick] :or {type :system}})Creates a java.time.Clock.
Options:
Creates a java.time.Clock.
Options:
- {:type :system :zone "UTC"}
- {:type :fixed :instant <instant|map|epoch-ms> :zone "UTC"}
- {:type :offset :clock <clock|opts> :offset <duration|map>}
- {:type :tick :clock <clock|opts> :tick <duration|map>}(now)(now clock)Returns the current Instant for the provided Clock (or system default).
Returns the current Instant for the provided Clock (or system default).
(now-map)(now-map clock)Returns a time map for now, optionally including the clock zone.
Returns a time map for now, optionally including the clock zone.
(plus value dur)(plus value unit amount)Adds a duration to a Clock, Instant, or time map.
When called with a Clock, uses now as the base. When called with a map, returns a map.
Adds a duration to a Clock, Instant, or time map. When called with a Clock, uses now as the base. When called with a map, returns a map.
(since instant)(since clock instant)Returns a Duration between an instant (or map) and now.
Returns a Duration between an instant (or map) and now.
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 |