This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-06
Channels
- # adventofcode (71)
- # aleph (1)
- # announcements (6)
- # aws (1)
- # babashka (27)
- # beginners (60)
- # biff (7)
- # calva (3)
- # clj-kondo (3)
- # clj-yaml (1)
- # clojure (60)
- # clojure-europe (43)
- # clojure-nl (3)
- # clojure-norway (75)
- # clojurescript (16)
- # code-reviews (7)
- # css (4)
- # cursive (47)
- # datascript (4)
- # events (5)
- # fulcro (37)
- # gratitude (5)
- # hyperfiddle (4)
- # introduce-yourself (4)
- # joyride (23)
- # juxt (4)
- # malli (4)
- # membrane (64)
- # nbb (8)
- # off-topic (12)
- # other-languages (6)
- # pathom (6)
- # polylith (9)
- # random (3)
- # rdf (66)
- # reitit (3)
- # releases (2)
- # shadow-cljs (18)
- # tree-sitter (10)
Hello! Is there any way to do this?
87 seconds -> 00:01:27
I found
(tick/new-duration 87 :seconds)
But whats next? 😃This feels a bit hacky, but works:
(t/format (t/formatter "HH:mm:ss") (t/+ (t/midnight) (t/new-duration 87 :seconds)))
;; => "00:01:27"
Otherwise I think you'd have to do it manually:
(let [duration (t/new-duration 87 :seconds)
hours (t/hours duration)
minutes (rem (t/minutes duration) 60)
seconds (rem (t/seconds duration) 60)]
(format "%02d:%02d:%02d" hours minutes seconds))
;; => "00:01:27"
ha, I have the same helper duration -> hrs,mins,secs https://github.com/dvingo/tick-util/blob/8eb28d04df664d616adab7a5779db48c1b924ead/src/main/dv/tick_util.cljc#L1421