The instant codec: an RFC 3339 instant <-> epoch milliseconds.
Pure on both legs: epoch-day arithmetic, no platform at all, no zone. A
pad keeps clj and cljs emitting the same bytes (no format).
This is the shape of java.time.Instant/toString: YYYY-MM-DDTHH:MM:SSZ,
with .mmm appended only when the millisecond-of-second is non-zero. A test
asserts that equality against java.time on the RFC 3339 samples (clj leg).
The instant codec: an RFC 3339 instant <-> epoch milliseconds. Pure on both legs: epoch-day arithmetic, no platform at all, no zone. A `pad` keeps clj and cljs emitting the same bytes (no `format`). This is the shape of `java.time.Instant/toString`: YYYY-MM-DDTHH:MM:SSZ, with `.mmm` appended only when the millisecond-of-second is non-zero. A test asserts that equality against java.time on the RFC 3339 samples (clj leg).
(format-instant ms)Epoch ms -> the shape of Instant.toString: YYYY-MM-DDTHH:MM:SSZ, with
.mmm appended only when the millisecond-of-second is != 0.
Epoch ms -> the shape of `Instant.toString`: YYYY-MM-DDTHH:MM:SSZ, with `.mmm` appended only when the millisecond-of-second is != 0.
(parse-instant s)An RFC 3339 instant (with Z or +HH:MM) -> epoch ms. Off the format -> :time/instant-format. Pure: no platform, no zone.
An RFC 3339 instant (with Z or +HH:MM) -> epoch ms. Off the format -> :time/instant-format. Pure: no platform, no zone.
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 |