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 :)



2

Yup, there's an API for that:

https://pico-8.fandom.com/wiki/Stat

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))

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



[Please log in to post a comment]