Random utilities, date and time functions.
Random utilities, date and time functions.
(days-ago n)Returns a time of days ago from now.
Returns a time of days ago from now.
(parse-duration v)(parse-duration v default-unit)Parses a duration from many forms.
Supported:
Notes:
Parses a duration from many forms.
Supported:
- nil -> nil
- java.time.Duration -> passthrough
- number -> treated as (default-unit), default is :minutes
- string:
* ISO-8601 Duration ("PT3M")
* compact ("3m", "0.05s", "250ms")
- vector/list:
* [time unit] or [unit time]
* even-length sequences are treated as (time unit) pairs and summed
- map:
* {:time <n> :unit <kw>} (unit optional -> default-unit)
Notes:
- Keyword shorthands like :m are intentionally NOT accepted here (they should throw),
even if you keep a broader duration-map for convenience elsewhere.(try-times & body)Executes body. If an exception is thrown, will retry. At most n retries are done. If still some exception is thrown it is bubbled upwards in the call chain.
Executes body. If an exception is thrown, will retry. At most n retries are done. If still some exception is thrown it is bubbled upwards in the call chain.
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 |