TimeDelta Object
Since: Dev Builds Only
The functionality described in this section requires a dev build of KumoMTA. You can obtain a dev build by following the instructions in the Installation section.
The TimeDelta
object represents a time interval.
Metamethods
The following metamethod are implemented on TimeDelta
objects:
__tostring
- returns a human readable duration string, the same as thehuman
field described below__eq
- compares twoTimeDelta
objects for equality+
- you may add aTimeDelta
to aTimeDelta
to produce a newTimeDelta
-
- you may subtract aTimeDelta
from aTimeDelta
to produce a newTimeDelta
Fields
The following fields epose information about the underlying TimeDelta
.
Fields are accessed using dot notation, like delta.seconds
.
seconds
- returns the TimeDelta expressed as a signed number of seconds (including fractional seconds)nanoseconds
- returns the TimeDelta expressed as a signed integer number of nanoseconds.milliseconds
- returns the TimeDelta expressed as a signed integer number of milliseconds.microseconds
- returns the TimeDelta expressed as a signed integer number of microseconds.human
- returns the TimeDelta expressed as a human readable string, such as5m
for a five minute duration.