Instantly share code, notes, and snippets.

What would you like to do?
evaluate some code at a given DateTime
(defn do-at* [date-time f]
(DateTimeUtils/setCurrentMillisFixed (.getMillis date-time))
(finally (DateTimeUtils/setCurrentMillisSystem))))
;; you might use this code like this:
(do-at* (DateMidnight. 2000 1 1)
(fn [] (DateMidnight.))) ;;=> (DateMidnight. 2000 1 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment