From 1c1597591dec44b4d8acc65779b4193f56eb4db4 Mon Sep 17 00:00:00 2001 From: Markus Date: Thu, 30 Nov 2023 14:56:04 +0000 Subject: [PATCH] readme: document date parsing #21 --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 7a4abbd..f1fc40d 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,13 @@ $ echo '{"a": {"b": [1, 2, 3]}}' | cq ':a :b (map inc)' (2 3 4) ``` +You can use `clojure.instant` (alias `inst`) to parse timestamps. + +```bash +$ echo '{"a": "2023-03-11T03:01:11.000Z"}' | cq :a inst/read-instant-timestamp +#inst "2023-03-11T03:01:11.000-00:00" +``` + Using `#|` you can use the current value as `.`. ```bash @@ -157,6 +164,7 @@ Currently supported threading operators for redirection: | `medley` | `medley.core` | `m` | `(m/mak-kv (fn [k v] [v k]))` | | `com.rpl/specter` | `com.rpl.specter` | `s` | `(s/transform [MAP-VALS MAP-VALS] inc)` | | `camel-snake-kebab` | `camel-snake-kebab.core` | `csk` | `csk/->SCREAMING_SNAKE_CASE` | +| `clojure.instant` | `clojure.instant` | `inst` | `inst/read-instant-timestamp` | ### Reader Macros