mirror of
https://github.com/mailscope/kumomta.git
synced 2026-08-22 04:18:21 +00:00
6f31d5514c
Motivated by https://github.com/KumoCorp/kumomta/pull/403, this commit introduces reasonably full featured Time and TimeDelta types built atop the chrono crate. closes: https://github.com/KumoCorp/kumomta/pull/403
382 B
382 B
kumo.time.parse_duration
{{since('dev')}}
local time = kumo.time.parse_duration(DURATION)
Parses a duration to create a TimeDelta object.
DURATION can be:
- A signed integer number of seconds
- A signed floating point number of seconds
- A duration string like
5 minutes
Example
local delta = kumo.time.parse_duration '5m'