Discuss Scratch

Ssecret321098
Scratcher
19 posts

Cloud Variables updating

Hi guys!

So i'm thinking to make a world clock on scratch, but i am having a bit of a problem thinking on how to keep the variables updated even when no one is running the project.

i'm just stumped on this, if you have a way, please tell me.

the varable i want to update:
(☁ UTC)


Edit: I'm a new scratcher, so I might not put in your soultions right away
also I just want to figure this out before I get scratcher status.

Last edited by Ssecret321098 (April 30, 2025 00:38:48)

N8_D_GR8_1
Scratcher
1000+ posts

Cloud Variables updating

Ssecret321098 wrote:

Hi guys!

So i'm thinking to make a world clock on scratch, but i am having a bit of a problem thinking o how to keep the variables updated even when no one is running the project.

i'm just stumped on this, and oif you have a way, please tell me

the varable i want to update:
(☁ UTC)


Edit: I'm a new scratcher, so i maght not put in your soultions right away
also I just want to figure this out before I get scratcher status
You actually don't need to use cloud variables for a world clock. There is a built-in blocks for that:
(days since 2000)//this will give precisely the number of days since 1/1/2000 at 00:00:00 UTC
this gives a precise enough number that you can also calculate the time (down to the second) from this.
Ssecret321098
Scratcher
19 posts

Cloud Variables updating

Thanks!

(I did not know that)

Last edited by Ssecret321098 (April 30, 2025 01:05:30)

N8_D_GR8_1
Scratcher
1000+ posts

Cloud Variables updating

Ssecret321098 wrote:

Thanks!

(I did not know that)
You're welcome!
Ssecret321098
Scratcher
19 posts

Cloud Variables updating

Now i need to figure out how to calculate the time
N8_D_GR8_1
Scratcher
1000+ posts

Cloud Variables updating

Ssecret321098 wrote:

Now i need to figure out how to calculate the time
([floor v] of (days since 2000))//days
([floor v] of (((days since 2000) mod (1))*(24)))//hours
([floor v] of (((days since 2000) mod ((1)/(24)))*((24)*(60))))//minutes
([floor v] of (((days since 2000) mod ((1)/((24)*(60))))*((24)*((60)*(60)))))//seconds
Ssecret321098
Scratcher
19 posts

Cloud Variables updating

Thanks
Ssecret321098
Scratcher
19 posts

Cloud Variables updating

I shared my world clock project!
Here it is:
https://scratch.mit.edu/projects/1107859347/
Hex_Code_Colors
Scratcher
20 posts

Cloud Variables updating

italics

Powered by DjangoBB