Skip to content

Commit 1c15975

Browse files
authored
readme: document date parsing #21
1 parent 2a4e92e commit 1c15975

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ $ echo '{"a": {"b": [1, 2, 3]}}' | cq ':a :b (map inc)'
101101
(2 3 4)
102102
```
103103

104+
You can use `clojure.instant` (alias `inst`) to parse timestamps.
105+
106+
```bash
107+
$ echo '{"a": "2023-03-11T03:01:11.000Z"}' | cq :a inst/read-instant-timestamp
108+
#inst "2023-03-11T03:01:11.000-00:00"
109+
```
110+
104111
Using `#|` you can use the current value as `.`.
105112

106113
```bash
@@ -157,6 +164,7 @@ Currently supported threading operators for redirection:
157164
| `medley` | `medley.core` | `m` | `(m/mak-kv (fn [k v] [v k]))` |
158165
| `com.rpl/specter` | `com.rpl.specter` | `s` | `(s/transform [MAP-VALS MAP-VALS] inc)` |
159166
| `camel-snake-kebab` | `camel-snake-kebab.core` | `csk` | `csk/->SCREAMING_SNAKE_CASE` |
167+
| `clojure.instant` | `clojure.instant` | `inst` | `inst/read-instant-timestamp` |
160168

161169

162170
### Reader Macros

0 commit comments

Comments
 (0)