Flashii Docs

(旧Railgun) if it ain't broke, we'll break it

User Tools

Site Tools


senses:packages:kmj-datetime

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
senses:packages:kmj-datetime [2025/07/28 01:55] – created flashsenses:packages:kmj-datetime [2026/04/27 00:21] (current) – removed lie flash
Line 2: Line 2:
  
 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 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 [[https://www.lua.org/manual/5.4/manual.html#luaL_newlib|luaL_newlib]] auxiliary library function, so all fields can be assumed to be functions. 
  
 ===== now ===== ===== now =====
Line 13: Line 11:
   now(): (timestamp: number)   now(): (timestamp: number)
  
-=== Arguments ===+==== Arguments ====
  
 //This function takes no arguments.// //This function takes no arguments.//
  
-=== Return values ===+==== Returns ====
  
   - The first return value contains the current time in milliseconds since January 1st, 1970 at 12:00 AM UTC.   - The first return value contains the current time in milliseconds since January 1st, 1970 at 12:00 AM UTC.
Line 29: Line 27:
   fromISO8601(iso8601str: string): (timestamp: number|nil)   fromISO8601(iso8601str: string): (timestamp: number|nil)
  
-=== Arguments ===+==== Arguments ====
  
   - The first argument should contain the ISO8601 string representation of the timestamp.   - The first argument should contain the ISO8601 string representation of the timestamp.
  
-=== Return values ===+==== Returns ====
  
   - The first return value will contain the amount of milliseconds since January 1st, 1970 at 12:00 AM UTC that the timestamp represents, or ''nil'' if the string could not be understood.   - The first return value will contain the amount of milliseconds since January 1st, 1970 at 12:00 AM UTC that the timestamp represents, or ''nil'' if the string could not be understood.
Line 45: Line 43:
   toISO8601(timestamp: number): (iso8601str: string)   toISO8601(timestamp: number): (iso8601str: string)
  
-=== Arguments ===+==== Arguments ====
  
   - The first argument should contain the amount of milliseconds since January 1st, 1970 at 12:00 AM UTC that must be converted to a ISO8601 string.   - The first argument should contain the amount of milliseconds since January 1st, 1970 at 12:00 AM UTC that must be converted to a ISO8601 string.
  
-=== Return values ===+==== Returns ====
  
   - The first return value will be an ISO8601 Zulu string representing the given numeric timestamp.   - The first return value will be an ISO8601 Zulu string representing the given numeric timestamp.
  
senses/packages/kmj-datetime.1753667704.txt.gz · Last modified: by flash