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