File: org-duration.el.html
This library provides tools to manipulate durations. A duration can have multiple formats:
- 3:12
- 1:23:45
- 1y 3d 3h 4min
- 1d3h5min
- 3d 13:35
- 2.35h
More accurately, it consists of numbers and units, as defined in
variable org-duration-units, possibly separated with white
spaces, and an optional "H:MM" or "H:MM:SS" part, which always
comes last. White spaces are tolerated between the number and its
relative unit. Variable org-duration-format controls durations
default representation.
The library provides functions allowing to convert a duration to,
and from, a number of minutes: org-duration-to-minutes and
org-duration-from-minutes. It also provides two lesser tools:
org-duration-p, and org-duration-h:mm-only-p.
Users can set the number of minutes per unit, or define new units,
in org-duration-units. The library also supports canonical
duration, i.e., a duration that doesn't depend on user's settings,
through optional arguments.
Defined variables (8)
org-duration--full-re | Regexp matching a duration expressed with units. |
org-duration--h:mm-re | Regexp matching a duration expressed with H:MM or H:MM:SS format. |
org-duration--h:mm:ss-re | Regexp matching a duration expressed H:MM:SS format. |
org-duration--mixed-re | Regexp matching a duration expressed with units and H:MM or H:MM:SS format. |
org-duration--unit-re | Regexp matching a duration with an unit. |
org-duration-canonical-units | Canonical time duration units. |
org-duration-format | Format definition for a duration. |
org-duration-units | Conversion factor to minutes for a duration. |
Defined functions (6)
org-duration--modifier | (UNIT &optional CANONICAL) |
org-duration-from-minutes | (MINUTES &optional FMT CANONICAL) |
org-duration-h:mm-only-p | (TIMES) |
org-duration-p | (S) |
org-duration-set-regexps | () |
org-duration-to-minutes | (DURATION &optional CANONICAL) |