Class: TimePoint
Represents a date and time, can be converted to/from a string.
Functions
| Name | Description |
|---|---|
.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
| Name | Description |
|---|---|
:epoch() | |
:toIso() | Creates an ISO formatted date time string |
Function declarations
Function: fromEpoch
Parses and returns a new TimePoint from a UNIX integer epoch
lua
function TimePoint.fromEpoch(
epoch
) endParameters:
- epoch (
integer) - The UNIX epoch as an integer
Returns:
- TimePoint - Returns a new TimePoint
Function: fromIso
Parses and returns a new TimePoint from an ISO formatted date time string
lua
function TimePoint.fromIso(
text
) endParameters:
- text (
string) - The date time string in ISO format
Returns:
- TimePoint - Returns a new TimePoint
Function: now
Returns a new TimePoint of the current (now) system time
lua
function TimePoint.now() endReturns:
- TimePoint - Returns a new TimePoint
Method declarations
Method: epoch
lua
function TimePoint:epoch() endReturns:
integer- Returns the epoch UNIX time as an integer
Method: toIso
Creates an ISO formatted date time string
lua
function TimePoint:toIso() endReturns:
string- Returns the time as an ISO formatted date time string
