试图找出什么是获得当前时间和MySQL记录的日期时间之间的差异的最佳方式。Clojure:现在和一条记录之间的时间差SQL日期时间
这里是我的代码
(ns clojure.example.hello
(:require [clj-time.coerce :as coerce]
[clj-time.local :as l]))
(let [timenow (l/local-now) ;; #object[org.joda.time.DateTime 0x333e8ce5 2017-02-23T21:44:11.022+11:00]
last-update (gettimelogged :timestamp)
;; returns SQL datetime which is 2017-02-23 19:20:15,
;; but gets converted into #inst "2017-02-23T08:20:15.000000000-00:00"]
(println (timenow - lastupdate)))
什么是运行timenow和最后更新的比较的最佳方式的一个片段?
此外,如果需要更新时间戳,最好的方法是什么?假如我想懒惰地将它加载到clojure,有时像{:NAME“Jim”:AGE“24”:CHECKDATE“NOW()”}
区别?女士? NS? – ClojureMostly
可能在几秒钟内不同将是最好的 – Stixxxx