diff --git a/primitive-data/dates/current-date/current-date.asciidoc b/primitive-data/dates/current-date/current-date.asciidoc index 16fc526f..a3c589f0 100644 --- a/primitive-data/dates/current-date/current-date.asciidoc +++ b/primitive-data/dates/current-date/current-date.asciidoc @@ -15,7 +15,7 @@ representing the present time and date. (defn now [] (java.util.Date.)) -(now) +(now) ;; -> #inst "2013-04-06T14:33:45.740-00:00" ;; A few seconds later... @@ -56,6 +56,29 @@ benchmarking is what you're after. Additionally, you shouldn't try to use +currentTimeMillis+ as some sort of unique value - UUIDs do a much better job of this. +If you decide you would rather use +https://github.com/clj-time/clj-time[clj-time] to work with dates, it +provides the a function +clj-time.core/now+ to get the current +DateTime+. + +[source,clojure] +---- +(require '[clj-time.core :as timec]) + +(timec/now) +;; -> # +---- + +Use +clj-time.local/local-now+ to retrieve a +DateTime+ instance for +the present scoped to your machine's local time zone. + +[source,clojure] +---- +(require '[clj-time.local :as timel]) + +(timel/local-now) +;; -> # +---- + ===== See Also * See <> for more information on the