Skip to main content
Version: Next

from_epoch

Interprets a duration as Unix time.

from_epoch(x:duration) -> time

Description

The from_epoch function interprets a duration as Unix time.

x: duration

The duration since the Unix epoch, i.e., 00:00:00 UTC on 1 January 1970.

Examples

Convert an integral Unix time

from {time: 1736525429}
time = from_epoch(time * 1s)
{x: 2025-01-10T16:10:29+00:00}

Interpret a duration as Unix time

from {x: from_epoch(50y + 12w + 20m)}
{x: 2020-03-13T00:20:00.000000}

See Also

as_secs, now, since_epoch