I am trying to calculate the difference between two DateTime instances using clj-time. I looked through the documentation and found clj-time.core/minus
and clj-time.core/minus-
but both require an instance of org.joda.time.ReadablePeriod
and not one of DateTime
. I would prefer to use cli-time, but if no solution exists, what would be the cleanest method of calculating the delta using Joda Time?
Thank you for the help.
I use this snippet very often in my daily work:
(ns project.namespace1
(:require [clj-time
[core :as t]] )
(let [start-time (t/now)]
... do lots of work ...
(t/in-millis (t/interval start-time (t/now))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With