The kmj-datetime package provides additional date/time handling functions to account for shortcomings with the date/time functions that are a part of the Lua io
package.
The runtime provides this library through the luaL_newlib auxiliary library function, so all fields can be assumed to be functions.
The now field contains a function that returns the current time represented as a number with the milliseconds since January 1st, 1970 at 12:00 AM UTC.
now(): (timestamp: number)
This function takes no arguments.
This field contains a function that takes an ISO8601 formatted date/time string and converts it to milliseconds since January 1st, 1970 at 12:00 AM UTC.
fromISO8601(iso8601str: string): (timestamp: number|nil)
nil
if the string could not be understood.Converts a number containing milliseconds since January 1st, 1970 at 12:00 AM UTC to a ISO8601 Zulu string representation.
toISO8601(timestamp: number): (iso8601str: string)