Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("json")
- local function get_time()
- local url = "http://worldtimeapi.org/api/timezone/Europe/Paris"
- local r = http.get(url)
- if r then
- local time = json.decode(r.readAll())
- time = time.datetime
- time = time:sub(12, 19)
- r.close()
- return time
- end
- end
- print(get_time())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement