Skip to content

luamod/mstime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mstime

Current Unix time in milliseconds.

Works with Lua 5.1, 5.2, 5.3, 5.4, 5.5, and LuaJIT.

Example

local mstime = require "mstime"

local now_ms = mstime.now()
local sec = math.floor(now_ms / 1000)
local ms = now_ms % 1000
local local_time = string.format("%s.%03d", os.date("%Y-%m-%d %H:%M:%S", sec), ms)

print("Current Time Report")
print("Timestamp ms :", now_ms)
print("Timestamp s  :", sec)
print("Local time   :", local_time)

Install

luarocks install mstime

About

Cross-platform Unix time in milliseconds for Lua.

Topics

Resources

License

Stars

Watchers

Forks

Contributors