libraryaddict

Untitled

Apr 23rd, 2012
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. res = http.get("http://nist.time.gov/timezone.cgi?UTC/s/0/")
  2. Res = {}
  3. if res then
  4. while true  do
  5. bla = res.readLine()
  6. if bla then
  7. Res[#Res+1] = bla
  8. else
  9. break
  10. end
  11. end
  12. res.close()
  13. end
  14. Time = string.sub(Res[49], 63, string.len(Res[49])-4)
  15. Date = string.sub(Res[50], 53, string.len(Res[50])-4)
  16. print("Now calculating how to split them!")
  17. DateFormat = {Time}
  18. Where = 1
  19. f = io.open("Test", "w")
  20. f:write(Date)
  21. f:close()
  22. for n=1,3 do
  23.     DateFormat[#DateFormat+1] = string.sub(Date, 1, string.find(Date, ", "))
  24.     Date = string.sub(Date, string.find(Date, ", "), string.len(Date))
  25. end
  26. print(#DateFormat)
  27. for n=1,#DateFormat do
  28.   print(DateFormat[n])
  29. end
Advertisement
Add Comment
Please, Sign In to add comment