Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用clj-time计算两个 DateTime 实例之间的差异。我查看了文档并发现clj-time.core/minus,clj-time.core/minus-但两者都需要一个实例org.joda.time.ReadablePeriod而不是DateTime. 我更喜欢使用 cli-time,但如果不存在解决方案,那么使用 Joda Time 计算增量的最简洁方法是什么?
clj-time.core/minus
clj-time.core/minus-
org.joda.time.ReadablePeriod
DateTime
感谢您的帮助。
我在日常工作中经常使用这个片段:
(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))))