Skip to content

Class: TimePoint

Functions

NameDescription
.fromEpoch(epoch)Parses and returns a new TimePoint from a UNIX integer epoch
.fromIso(text)Parses and returns a new TimePoint from an ISO formatted date time string
.now()Returns a new TimePoint of the current (now) system time

Methods

NameDescription
:epoch()
:toIso()

Function declarations

Function: fromEpoch

Parses and returns a new TimePoint from a UNIX integer epoch

lua
function TimePoint.fromEpoch(
    epoch
) end

Parameters:

  • epoch (integer) - The UNIX epoch as an integer

Returns:

Function: fromIso

Parses and returns a new TimePoint from an ISO formatted date time string

lua
function TimePoint.fromIso(
    text
) end

Parameters:

  • text (string) - The date time string in ISO format

Returns:

Function: now

Returns a new TimePoint of the current (now) system time

lua
function TimePoint.now() end

Returns:

Method declarations

Method: epoch

lua
function TimePoint:epoch() end

Returns:

  • integer - Returns the epoch UNIX time as an integer

Method: toIso

lua
function TimePoint:toIso() end

Returns:

  • string - Returns the time as an ISO formatted date time string