It's the first time I'm using the PICO-8 clock. Was just experimenting.
The time of this writing is:
09-10-19 at 1:29pm.
Let me write some code to confirm this:
cls()
print("year...."..stat(80))
print("month..."..stat(81))
print("day....."..stat(82))
print("hour...."..stat(83))
print("minute.."..stat(84))
print("second.."..stat(85))
repeat
flip()
until forever
|
Yet when I run this the HOUR says 18. Looking at the clock on my computer though it still says it's 1pm + 32-minutes. What gives ?
Presumably your computer time zone isn't UTC.
"80..85 UTC time: year, month, day, hour, minute, second" Source: pico-8.txt
"Coordinated Universal Time (abbreviated to UTC) is the primary time standard by which the world regulates clocks and time. It is within about 1 second of mean solar time at 0° longitude, and is not adjusted for daylight saving time." Source: wikipedia
Current UTC (as I type this) is 18:48 according to https://time.is/UTC
Well shoot that's a lotta work for PICO. Wouldn't it be easier just to read Windows onboard time ?
I mean that's what I have throughout my whole house.
More importantly, =IS= there a way I can read the current time my clock (or other people's clocks) show ?
Really ?? Checking ...
Superb, Remcode ! Thanks, JWinslow.
. . .
Enargy, take note. Your game (my favorite one, remember ?) is using universal time. I couldn't figure out why it was acting wonky here when midnight came around.
https://www.lexaloffle.com/bbs/?tid=31955
You might adjust the code to match computer clocks instead of universal. It was from your code I got curious about clock-driven carts.
. . .
Here is new CLOCK I wrote. Should be accurate to computer listed time:
-- correct time
--
cls()
print"█ universal time █"
print("year.... "..stat(80))
print("month... "..stat(81))
print("day..... "..stat(82))
print("hour.... "..stat(83))
print("minute.. "..stat(84))
print("second.. "..stat(85))
repeat
flip()
until btnp(4)
print""
print"█ your time █"
print("year.. "..stat(90))
d=stat(92) t="th"
if (d%10==1) t="st"
if (d%10==2) t="nd"
if (d%10==3) t="rd"
s=stat(91)
m=sub("janfebmaraprmayjunjulaugsepoctnovdec",s*3+1,s*3+3)
print("date.. "..m.." "..d..t)
h=stat(93) t="am" v=h%12
if (h>=12 and h<=23) t="pm" v=h-12
if (v==0) v=12
m=stat(94)
if (m<10) m="0"..m
print("time .."..v..":"..m..t)
repeat
flip()
until btnp(4)
repeat
flip()
until not btn(4)
|
[Please log in to post a comment]



