Log In  

Is there any way to get the system time? I know we can track the seconds since launch of the program but some type of unix timestamp would be nice. I want to build a game that tracks playtime between sessions. Think of a pico+tamagotchi mash up :)

P#87483 2021-02-10 20:56


Yup, there's an API for that:


print("local time: "..stat(93)..":"..stat(94)..":"..stat(95))
print("date: "..stat(92).."/"..stat(91).."/"..stat(90))

print("utc time: "..stat(83)..":"..stat(84)..":"..stat(85))
print("date: "..stat(82).."/"..stat(81).."/"..stat(80))
P#87484 2021-02-10 21:35

Huzzah thanks @Astorek86 I'll give that a try.

P#87485 2021-02-10 21:36

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-06-08 14:26:45 | 0.018s | Q:14