Datomic get year from instant

229 views Asked by At

I have an attribute of type instant and I want to query for the year.

[:find ?year
 :where
 [?t :x/date ?date]
 [((fn [dt] (+ (.getYear dt) 1900)) ?date) ?year]]

Is there a better way to do this query?

0

There are 0 answers