Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
- US-Systems
-
Scratcher
1000+ posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
Hello everybody. I created this topic to ask you how to create a countdown that indicates days, hours, minutes and seconds remaining at the time of a certain event. For example, if my event is to occur at 13:53:01 on May 10, 2021, then my countdown should indicate how much time remains at 13:53:01 on that day. So I ask you if you know of any scripts that allow this. Thank you!


when green flag clicked
ask [Please reply to my question, is very important!] and wait
- deck26
-
Scratcher
1000+ posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
- US-Systems
-
Scratcher
1000+ posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
https://scratch.mit.edu/projects/419289093/ may helpSorry, but that's not what I meant. I meant a countdown like MaxyBrian's ToS countdown project (look for it and you'll understand everything). But I need simple scripts.
- Minecraft7575
-
Scratcher
21 posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
Try using variables?
Scratch has pre built in variables like time and date, but i'm not sure how you make a countdown
here is an example of a clock https://scratch.mit.edu/projects/420439563/
Will get back to you when I figure out somthing!
Scratch has pre built in variables like time and date, but i'm not sure how you make a countdown
here is an example of a clock https://scratch.mit.edu/projects/420439563/
Will get back to you when I figure out somthing!
- US-Systems
-
Scratcher
1000+ posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
Try using variables?No, I didn't mean this. I mean:
Scratch has pre built in variables like time and date, but i'm not sure how you make a countdown
here is an example of a clock https://scratch.mit.edu/projects/420439563/
Will get back to you when I figure out somthing!
https://scratch.mit.edu/projects/419289093/ may help(omissis) I meant a countdown like MaxyBrian's ToS countdown project (look for it and you'll understand everything). But I need simple scripts.
- US-Systems
-
Scratcher
1000+ posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
Bump
- deck26
-
Scratcher
1000+ posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
Please clarify what you want. You say you want an event to occur at a certain time but that you want to know how much time remains at that time. Surely at that point no time is left? Can you provide a link to the project you refer to rather than expect anyone helping here to search for it?
If you want to know how much time is left until some event in the future the easiest option is to use the current value off the days-since-2000 block and compare it to the value that will be correct when your event occurs. That is where my project helps.
So if the event will occur at 12345 days since 2000 and it is currently 12340.5 days since 2000 you know you have 4.5 days to go and you represent that in days, hours, minutes etc.
If you want to know how much time is left until some event in the future the easiest option is to use the current value off the days-since-2000 block and compare it to the value that will be correct when your event occurs. That is where my project helps.
So if the event will occur at 12345 days since 2000 and it is currently 12340.5 days since 2000 you know you have 4.5 days to go and you represent that in days, hours, minutes etc.
- Minecraft7575
-
Scratcher
21 posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
Here is a countdown engine!
https://scratch.mit.edu/projects/525931275/
I just used math blocks:
Hope this helps!
https://scratch.mit.edu/projects/525931275/
I just used math blocks:
set [Countdown Day] to ((target Day) - (current [Day]))
Hope this helps!
Last edited by Minecraft7575 (May 5, 2021 12:53:10)
- US-Systems
-
Scratcher
1000+ posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
Here is a countdown engine!Thanks! Now I will try it!
https://scratch.mit.edu/projects/525931275/
I just used math blocks:set [Countdown Day] to ((target Day) - (current [Day]))
Hope this helps!

- US-Systems
-
Scratcher
1000+ posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
Here is a countdown engine!I report a bug: the value Minutes Remaining is always a negative number. Can you please fix this bug? Thanks!
https://scratch.mit.edu/projects/525931275/
I just used math blocks:set [Countdown Day] to ((target Day) - (current [Day]))
Hope this helps!
- Minecraft7575
-
Scratcher
21 posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
Yeah, I saw this, will work on it!
EDIT: I guess I fixed it by changing the 0 to a 60, and editing everything else. I am checking it by using this: https://www.timeanddate.com/countdown/roadtrip?iso=20210617T15&p0=4513&msg=Countdown+Test&font=hand
EDIT: I guess I fixed it by changing the 0 to a 60, and editing everything else. I am checking it by using this: https://www.timeanddate.com/countdown/roadtrip?iso=20210617T15&p0=4513&msg=Countdown+Test&font=hand
Last edited by Minecraft7575 (May 5, 2021 13:01:35)
- deck26
-
Scratcher
1000+ posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
So if two people run this in different time zones should they see the same value or a local value? The days since 2000 is the only way to ensure everyone sees the same thing. You may not care about that of course.
- Minecraft7575
-
Scratcher
21 posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
So if two people run this in different time zones should they see the same value or a local value? The days since 2000 is the only way to ensure everyone sees the same thing. You may not care about that of course.
So if two people run this in different time zones should they see the same value or a local value? The days since 2000 is the only way to ensure everyone sees the same thing. You may not care about that of course.
I did not think about that. I think it would show local values, like @US-Systems is in Italy but I am in US, so he would see it as 3 p.m. in his time zone but I would see it is 3 p.m. in my time zone.
I guess you are right, will look into it!
- deck26
-
Scratcher
1000+ posts
How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?
I know your project won't work as it stands in those circumstances, my question was to the OP.So if two people run this in different time zones should they see the same value or a local value? The days since 2000 is the only way to ensure everyone sees the same thing. You may not care about that of course.
I did not think about that. I think it would show local values, like @US-Systems is in Italy but I am in US, so he would see it as 3 p.m. in his time zone but I would see it is 3 p.m. in my time zone.
I guess you are right, will look into it!
Last edited by deck26 (May 5, 2021 13:17:31)
- Discussion Forums
- » Help with Scripts
-
» How can I create a countdown indicating the days, hours, minutes and seconds remaining at the time of a certain event?


