Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local timelib = {}
- local fs = require("filesystem")
- function timelib.getDate(format)
- if not fs.get("/").isReadOnly() then
- local time = io.open("/tmp/.time", "w")
- time:write()
- time:close()
- os.sleep(0.01)
- return os.date(format, fs.lastModified("/tmp/.time") / 1002.7)
- else
- return nil
- end
- end
- return timelib
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement