Real time clock [Extension] [Deprecated]

I made a new extension for a real time clock thanks richard for squeezing in the feature to get a unix with that I could create this cool extension I will make a github extension out of this soon

PNG Import

Extension URL

Paste into the extension search bar.

2 Likes

THIS IS AWESOME! I’ve been waiting for this for so long!

can you put in the extension utc-4

https://github.com/NotARealAccSorry/RealTimeClock added more timezones

also @AlexK my goat could you add this to the topic start

Roger that.

This is awesome! Could this be used to track time that’s passed when a game is closed? I could use that to make the zen garden in pvz

2 Likes

Can you post an example of it working! I would love to add this to the Awesome Arcade website but I can’t get it to work myself, maybe I’m missing something really obvious lol

glancing at the code for this project, your approach isn’t going to work in makecode. there’s no way to run browser javascript from an extension like you’re trying to do in the runBrowserJS function (that would be a pretty huge security risk!)

that being said, i did indeed sneak this functionality into the browser events extension; i just never added blocks for it. here’s an example of how to use the javascript apis:

2 Likes

Why a have only this when i paste the extension? In your project it have more block

ye

Huh your right I fixed it with the png version an it should owrk

yeah I saw that one post with that I forgot where tho I found those apis and turned them into an extension I asked ai what a unix was since I got a crazy long number

@TheEarth yeah, times returned by those APIs are in milliseconds since the start of the current epoch (January 1st, 1970), aka unix time, which is the traditional way that times are represented on computers. that’s why the current time function returns such a crazy high number.

fun fact: since that number is so high, it’s actually going to be a problem in 2038 for some computers

2 Likes

@AlexK please lock this toic and add [Deprecated] to the end of my topic name