Advertisement
Ewgeniy

Time

Sep 2nd, 2021 (edited)
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. local fs = require("filesystem")
  2.  
  3. local function getTime()
  4.     local f = io.open("/tmp/time", "w")
  5.     f:write("time")
  6.     f:close()
  7.    
  8.     local timestamp = fs.lastModified("/tmp/time") / 1000 + 3600 * 3 --Умножаем на часовой пояс, в моём случае GMT +3
  9.     return os.date("%d.%m.%Y %H:%M:%S", timestamp) --Реальное время в формате День.Месяц.Год Час:Минута:Секунда
  10. end
  11.  
  12. print(getTime)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement