ecco7777

Lua realtime

Nov 12th, 2015
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. while true do
  2. term.setCursorPos(1,1)
  3. timeHandle = http.get("http://www.timeapi.org/utc/in+one+hours")
  4. time = timeHandle.readLine()
  5. day=tonumber(time:sub(9, 10))
  6. month=tonumber(time:sub(6, 7))
  7. hour=tonumber(time:sub(12, 13))
  8. minute=tonumber(time:sub(15, 16))
  9. sec=tonumber(time:sub(18, 19))
  10. term.clear()
  11. print(day,".",month,".2015")
  12. print(hour,":",minute)
  13. sleep(1)
  14. end
Add Comment
Please, Sign In to add comment