[Extension] arcade-rtc (Real Time Clock)

Hey folks!

I was inspired by @TheEarth’s recent real time clock extension to make my own! I present: riknoll/arcade-rtc

This is a browser-only extension for getting the current time. Times in this extension are represented in the traditional browser format, which is milliseconds since the epoch (January 1, 1970). All functions will automatically convert that time into the local time zone based on the settings of the player’s browser/computer.

Also, because it’s fun, this extension includes a few blocks for getting the current lunar phase! This is based on data from the US Astronomical Applications Department and should be accurate for any date between 2026 and 2050.

Nothing would please me more than people starting to make their games behave differently if it’s a full moon.

11 Likes

Me about to make an animal crossing like game where the time is equal to the real world time and certain things happen on special days. Or a game where the current real world lunar cycle effects your cults activies or something.

There is lots of potential here.

5 Likes

Now we just need the ability to see when the MakeCode streams will be cancelled. /j

1 Like

Hm, this could work really well for a Kerbal Space Program game - accurate times, and then I would have to make a physics engine and stuff like that. Guess I’ll try, why not? Time to destroy everyone’s computers with a really super sort-of accurate rocket simulator (my computer’s doomed, too)!

1 Like

hmm this could be used alot, and because I always feel like doing so, I made a tiny project using it. One question, why does it add browser extensions? Also, can you make it possible to get the milliseconds?

BRO YOU HAD TO STEAL MY THUNDER/j I’m fine with this lol

1 Like

how did you get local time zone HOW???

it adds the browser extension because the RTC apis it uses are defined by that extension. it’s a required dependency

and to get milliseconds:

@TheEarth sorry! i tried to give you a shout out as the inspiration.

and the local time zone is already included in the dates in the browser events extension. you can see the actual implementation of those functions here:

all of the methods on the Date type return local time by default.