Files
kumomta/docs/reference/kumo.time/parse_duration.md
T
Wez Furlong 6f31d5514c new Time and TimeDelta objects for lua
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
2025-10-22 17:26:35 +01:00

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'