Skip to content

Commit

Permalink
readme: document date parsing #21
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-wa committed Nov 30, 2023
1 parent 2a4e92e commit 1c15975
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1c15975

Please sign in to comment.