Advertisement
Guest User

time

a guest
Aug 14th, 2017
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. local fs = require("filesystem")
  2.  
  3. function os.dateRL(format)
  4. if not fs.get("/").isReadOnly() then
  5. local time = io.open("/tmp/.time", "w")
  6. time:write()
  7. time:close()
  8. os.sleep(0.01)
  9. return os.date(format, fs.lastModified("/tmp/.time") / 1002.7)
  10. else
  11. return os.date(format)
  12. end
  13. end
  14.  
  15. print(os.dateRL("%x %X"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement