# Clock Extension

**URL:** https://forum.makecode.com/t/clock-extension/19191
**Category:** Game Design
**Tags:** extension
**Created:** [April 14, 2023, 9:34pm UTC](https://forum.makecode.com/t/clock-extension/19191 "2023-04-14T21:34:48Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)
#### Post date: [April 14, 2023, 9:34pm UTC](https://forum.makecode.com/t/clock-extension/19191/1 "2023-04-14T21:34:48Z")

</div>

> **[GitHub - Blobbey2000/pxt-clock: Makes blocks that create an in-game clock....](https://github.com/Blobbey2000/pxt-clock)**
>
> Makes blocks that create an in-game clock. The clock can run at whatever speed you want it to. - GitHub - Blobbey2000/pxt-clock: Makes blocks that create an in-game clock. The clock can run at what...

Here’s what the blocks look like:  
 ![clock_extension_blocks](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/1/1b7c20514e80a512b0526654ca13f81870076b57.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/f71244c156ce40dcd621406e4ca73462c31b16a8.png)  
The clock time is returned as a string and should be compatible with any string-accepting block.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/7004589cbdb40f6798d8ebfb368eb289539ad35d.png)  
You can use the `clock on true/false` block to pause and un-pause the clock, and the boolean can be used to check whether or not the clock is running.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/5/596cbc94ca2580aebf894d0b76a74d6fd0010283.png)  
The `set clock speed to $speed ms` block can be used to change the speed of the clock, so you could effectively make the clock run on real-time if you used an ask for number block.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/6989466399c1520670b9d76ede999b2b39a4af33.png)  
The number you put into the block will determine the number of milliseconds it takes for the minute to change in the clock. Inputting 60000 ms will mean that each minute for the clock is a minute in real-life.

Also, any negative number that is put in for the clock time will be multiplied by -1 to make it a positive number, and if 0 is put in for the hour, it will be turned to 1 instead. Additionally, if the hours value is set to a number of 13 or greater, the hour will be set to 1, and the am will change to pm or vice versa. Something similar will happen with the minutes. If you set it to 60+, the hour value will change by 1.

Yeesh! That’s a lot of words…  
Anyways, enjoy!

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [April 15, 2023, 1:54am UTC](https://forum.makecode.com/t/clock-extension/19191/2 "2023-04-15T01:54:11Z")

</div>

The extension I didn’t know I needed!

Suggestions:

- “set clock speed to [number] ms” was a little confusing at first, I suggest changing it to something like, “set duration of one minute to [number] ms”
- Add second support? That will probably change your “set clock speed” block though. And you will also need a way to disable/enable this, as some games may not want/need this.

---

<div class="post-metadata">

### Author: ![BoostedGames](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/boostedgames/32/29419_2.png) [@BoostedGames](https://forum.makecode.com/u/BoostedGames)
#### Post date: [April 15, 2023, 1:56am UTC](https://forum.makecode.com/t/clock-extension/19191/3 "2023-04-15T01:56:35Z")

</div>

very interesting, nice!

---

<div class="post-metadata">

### Author: ![EpicKitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/epickitty/32/8358_2.png) [@EpicKitty](https://forum.makecode.com/u/EpicKitty)
#### Post date: [April 16, 2023, 10:06pm UTC](https://forum.makecode.com/t/clock-extension/19191/4 "2023-04-16T22:06:49Z")

</div>

How does this work and is the Meowbit supported? Looks cool though.

---

<div class="post-metadata">

### Author: ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)
#### Post date: [April 16, 2023, 10:16pm UTC](https://forum.makecode.com/t/clock-extension/19191/5 "2023-04-16T22:16:50Z")

</div>

Okay, I’ve changed the set clock speed block to be less confusing (`set one second duration to [number]`), and the clock now supports seconds! Just expand the `return clock time` block and you will have the option to make the seconds visible! The am/pm system was causing problems, so I took it out.

---

<div class="post-metadata">

### Author: ![Unique](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unique/32/32724_2.png) [@Unique](https://forum.makecode.com/u/Unique)
#### Post date: [April 16, 2023, 10:16pm UTC](https://forum.makecode.com/t/clock-extension/19191/6 "2023-04-16T22:16:57Z")

</div>

✨ Simple suggestion here ✨

- It would be really neat if you added individual parameter blocks for both minutes and seconds
- Similar to what @UnsignedArduino said, changing the wording of the `set clock speed to $number ms` to `set tick speed to $number ms` would make it a bit easier to understand the intended usage of that block

Alr gotta go byeeee!

---

<div class="post-metadata">

### Author: ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)
#### Post date: [April 16, 2023, 10:33pm UTC](https://forum.makecode.com/t/clock-extension/19191/7 "2023-04-16T22:33:30Z")

</div>

This extension can be used to make an in-game clock. Just use the `set clock time to` block and input the hour, minute and second to make it! You can then use the `clock time` return block to get the clock time, and the rest of the blocks are just extra settings for the clock. (I hope this answers your question.) Also, I haven’t tested the extension on MeowBit yet.

---

<div class="post-metadata">

### Author: ![jackal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jackal/32/19506_2.png) [@jackal](https://forum.makecode.com/u/jackal)
#### Post date: [April 16, 2023, 11:08pm UTC](https://forum.makecode.com/t/clock-extension/19191/8 "2023-04-16T23:08:02Z")

</div>

What happened to @E-EnerG-Gamecentral? They would love this extension. Would help with arcadeOS’ too.

---

<div class="post-metadata">

### Author: ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)
#### Post date: [April 17, 2023, 4:46pm UTC](https://forum.makecode.com/t/clock-extension/19191/9 "2023-04-17T16:46:29Z")

</div>

He(?)'s been inactive for a while now, hopefully he comes back to the forums eventually

---

<div class="post-metadata">

### Author: ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)
#### Post date: [April 17, 2023, 6:19pm UTC](https://forum.makecode.com/t/clock-extension/19191/10 "2023-04-17T18:19:38Z")

</div>

Alright! I’ve added the am/pm system back in! It’s a little different, but thankfully it works far better now!

---

<div class="post-metadata">

### Author: ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)
#### Post date: [April 20, 2023, 1:08am UTC](https://forum.makecode.com/t/clock-extension/19191/11 "2023-04-20T01:08:18Z")

</div>

@UnsignedArduino, would it be possible for you to add this extension to your [Awesome Arcade Extensions](https://forum.makecode.com/t/useful-arcade-extensions/4472) GitHub page? Totally fine if not. 🙂

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [April 20, 2023, 9:26pm UTC](https://forum.makecode.com/t/clock-extension/19191/12 "2023-04-20T21:26:47Z")

</div>

I’ve submitted an [issue](https://github.com/UnsignedArduino/Awesome-Arcade-Extensions/issues/75) for it. I will get around to it. (eventually \>.\>)

---

<div class="post-metadata">

### Author: ![MeatballDev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/meatballdev/32/28502_2.png) [@MeatballDev](https://forum.makecode.com/u/MeatballDev)
#### Post date: [September 20, 2024, 4:52pm UTC](https://forum.makecode.com/t/clock-extension/19191/13 "2024-09-20T16:52:16Z")

</div>

I HAVE COME TO REVIVE THE setonesecondduration  
Can you add the ability to connect to IRL TIme

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [September 20, 2024, 8:37pm UTC](https://forum.makecode.com/t/clock-extension/19191/14 "2024-09-20T20:37:58Z")

</div>

That’s not how MakeCode works

---

<div class="post-metadata">

### Author: ![DangerNoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dangernoodle/32/14797_2.png) [@DangerNoodle](https://forum.makecode.com/u/DangerNoodle)
#### Post date: [September 20, 2024, 8:52pm UTC](https://forum.makecode.com/t/clock-extension/19191/15 "2024-09-20T20:52:22Z")

</div>

> [@Blobbey](#):
>
> Inputting 60000 ms will mean that each minute for the clock is a minute in real-life.

@Blobbey literally did…

---

<div class="post-metadata">

### Author: ![undefined\_62796](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/undefined_62796/32/31874_2.png) [@undefined\_62796](https://forum.makecode.com/u/undefined_62796)
#### Post date: [August 3, 2025, 11:57pm UTC](https://forum.makecode.com/t/clock-extension/19191/16 "2025-08-03T23:57:58Z")

</div>

Hey Blobbey, Could you add a way to specifically change hours, minutes and seconds?

---

<div class="post-metadata">

### Author: ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)
#### Post date: [August 6, 2025, 9:45pm UTC](https://forum.makecode.com/t/clock-extension/19191/17 "2025-08-06T21:45:15Z")

</div>

Sorry, I don’t completely understand what you mean. You can set the current time and the duration of each second with the blocks in the extension, so I don’t know what you mean by “change”.

---

<div class="post-metadata">

### Author: ![undefined\_62796](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/undefined_62796/32/31874_2.png) [@undefined\_62796](https://forum.makecode.com/u/undefined_62796)
#### Post date: [August 24, 2025, 11:12pm UTC](https://forum.makecode.com/t/clock-extension/19191/18 "2025-08-24T23:12:00Z")

</div>

I mean something like this: “Set Clock [Seconds] to (0)”

---

<div class="post-metadata">

### Author: ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)
#### Post date: [August 28, 2025, 4:41am UTC](https://forum.makecode.com/t/clock-extension/19191/19 "2025-08-28T04:41:40Z")

</div>

That’s a good idea, but I don’t plan on updating the extension anytime soon. You’re welcome to try to add that function in yourself if you want though.

---

<div class="post-metadata">

### Author: ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://forum.makecode.com/u/Mik)
#### Post date: [May 21, 2026, 10:47pm UTC](https://forum.makecode.com/t/clock-extension/19191/20 "2026-05-21T22:47:52Z")

</div>

Where is the arcade-datetime extension?

[Next page](https://forum.makecode.com/t/clock-extension/19191.md?page=2)
