Skip to content

Instantly share code, notes, and snippets.

@rotaliator
Created November 23, 2023 16:56
Show Gist options
  • Save rotaliator/c934938e6b3006c7ef353b937a6f3ea9 to your computer and use it in GitHub Desktop.
Save rotaliator/c934938e6b3006c7ef353b937a6f3ea9 to your computer and use it in GitHub Desktop.
Elisp time between
(defun rot-time-duration (begin &optional end)
(if end
(org-minutes-to-clocksum-string
(- (org-duration-to-minutes end)
(org-duration-to-minutes begin)))
(seq-let (begin end) (mapcar 's-trim (s-split "-" begin))
(rot-time-duration begin end))))
;; (rot-time-duration "9:00" "17:00")
;; (rot-time-duration "9:00 - 17:00")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment