# Where is Clock in Thunkable X?

**URL:** <https://community.thunkable.com/t/where-is-clock-in-thunkable-x/38786>\
**Category:** Questions about Thunkable X\
**Created:** [August 2, 2018, 1:25pm UTC](https://community.thunkable.com/t/where-is-clock-in-thunkable-x/38786 "2018-08-02T13:25:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![derence.walk](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@derence.walk](https://community.thunkable.com/u/derence.walk)\
**Post date:** [August 2, 2018, 1:25pm UTC](https://community.thunkable.com/t/where-is-clock-in-thunkable-x/38786/1 "2018-08-02T13:25:26Z")

</div>

Hi everybody!

I’m trying to set it up so that when a button is pressed, it plays a sound based on what day of the week it is. (e.g., If it’s Tuesday, I have a sound that says “Today is Tuesday!”

In the Thunkable classic Android version, this was done with “call Clock1.Now” Is there a similar function in Thunkable X?

The only thing I see in sensors is “Timer”. I thought maybe that would be the same as clock, but after a few hours of spinning my wheels and searching online, I’m still not having success.

Thanks in advance for any help! 🙂

---

<div class="post-metadata">

**Author:** ![Rob\_Schoemaker](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rob_schoemaker/32/21023_2.png) [@Rob\_Schoemaker](https://community.thunkable.com/u/Rob_Schoemaker)\
**Post date:** [August 2, 2018, 2:58pm UTC](https://community.thunkable.com/t/where-is-clock-in-thunkable-x/38786/2 "2018-08-02T14:58:16Z")

</div>

Unfortunately the clock is not (yet) available in ThunkableX. ☹

See [Help/Feature request: Access to device clock / enhanced timer](http://community.thunkable.com/t/help-feature-request-access-to-device-clock-enhanced-timer/33396)

I am also still hoping there will be a clock component soon, so that I can finish my app. Fingers crossed…

Regards Rob

---

<div class="post-metadata">

**Author:** ![derence.walk](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@derence.walk](https://community.thunkable.com/u/derence.walk)\
**Post date:** [August 18, 2018, 5:25pm UTC](https://community.thunkable.com/t/where-is-clock-in-thunkable-x/38786/3 "2018-08-18T17:25:30Z")

</div>

Hi @Rob_Schoemaker,

Thank you for your response! By reading through the thread you linked, I was able to learn about APIs and the timezonedb. 🙂

I’ve made some good progress I think, but I’ve been stumped for a while. If you have a moment, will you help me?

My app has a button that, when pressed, should play a different sound for each day of the month. I think I can do this by getting date info from timezonedb, setting a label’s text to display the date, then have a 31-part if/then block in the play button (if label text says the date is 01, play Sound1, if label text says the date is 02, play Sound2, etc.).

Here are the blocks I have so far:

 ![03%20AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/1/f1eef0e924c6b5c78977050901e7319891d704db.png)

When the screen starts, we get info from [http://api.timezonedb.com/v2/get-time-zone?key=J93B6J5QTQ4M&format=json&by=zone&zone=America/Chicago](http://api.timezonedb.com/v2/get-time-zone?key=J93B6J5QTQ4M&format=json&by=zone&zone=America/Chicago)

The the text in Label1 is set to text from timezonedb’s “formatted” property.

Label 1 now displays “2018-08-18 12:03:02” which is good because the day is in there, but there’s also the year, month, and time, which I don’t need.

I need to figure out a way to have the play button ignore everything except for the day.

Is there a way to tell the play button “Look at the 9th and 10th character of the text in this label…if it’s 01 play Sound1”?

Or maybe there’s a way to tell the label “Only grab the 9th and 10th character from this property and set it as the text?”

Sorry for not quite having all the terminology down yet. Hopefully it comes across! Any ideas?

Thank you!

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [August 19, 2018, 5:24am UTC](https://community.thunkable.com/t/where-is-clock-in-thunkable-x/38786/4 "2018-08-19T05:24:27Z")

</div>

Hi,

To get a substring (9 and 10 character) from the string, use the block

![%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/0/f0de4f756c3de3a58219c6bbeb9d006377a6da6d.png)

---

<div class="post-metadata">

**Author:** ![derence.walk](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@derence.walk](https://community.thunkable.com/u/derence.walk)\
**Post date:** [August 19, 2018, 5:52am UTC](https://community.thunkable.com/t/where-is-clock-in-thunkable-x/38786/5 "2018-08-19T05:52:50Z")

</div>

Wow! Incredible and so simple! Thanks for your help 🙂

---

<div class="post-metadata">

**Author:** ![Rob\_Schoemaker](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rob_schoemaker/32/21023_2.png) [@Rob\_Schoemaker](https://community.thunkable.com/u/Rob_Schoemaker)\
**Post date:** [August 19, 2018, 11:29am UTC](https://community.thunkable.com/t/where-is-clock-in-thunkable-x/38786/6 "2018-08-19T11:29:07Z")

</div>

And instead of creating a large number of if–then–else blocks, I would use the filename of the sound to select the sound.

So for example name the files sound01.mp3 (sound for day 1), sound02.mp3 (sound for day 2), etc etc. And then use something like the blocks below to construct the filename to use from the day number that you got from timezonedb:

 ![08](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/d/ed5efd4d74bcdd7326af2c9fef086c8b2b10d113.png)

Saves you a lot of blocks 😉

Regards Rob

---

<div class="post-metadata">

**Author:** ![derence.walk](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@derence.walk](https://community.thunkable.com/u/derence.walk)\
**Post date:** [August 19, 2018, 6:31pm UTC](https://community.thunkable.com/t/where-is-clock-in-thunkable-x/38786/7 "2018-08-19T18:31:17Z")

</div>

Oh that is so cool! Much better solution than all the if/thens. Thanks for your help Rob!

---

<div class="post-metadata">

**Author:** ![Stuart\_Buchan](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stuart_buchan/32/27467_2.png) [@Stuart\_Buchan](https://community.thunkable.com/u/Stuart_Buchan)\
**Post date:** [November 5, 2018, 1:35am UTC](https://community.thunkable.com/t/where-is-clock-in-thunkable-x/38786/8 "2018-11-05T01:35:28Z")

</div>

I’m the same Rob. I’ve built an app on Thunkable Classic for Android, imported from AI2 and it uses Epoch time from the Clock component to seed a random number generator.

I’m interested in building apps for Apple devices hence the interest in the X version.

This workaround using [api.timezonedb.com](http://api.timezonedb.com) for getting Epoch time looks interesting, so I’ll explore that meantime and hope that the ThunkableX team release a Clock component ASAP.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:54am UTC](https://community.thunkable.com/t/where-is-clock-in-thunkable-x/38786/9 "2024-11-08T11:54:50Z")

</div>


