Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Is there a current day of month block?
- BrightCloud33
-
Scratcher
9 posts
Is there a current day of month block?
I'm trying to make a project where something will trigger on a certain day/holiday, say like Easter, Christmas, etc. But there isn't a current day of month block or anything similar, and I can't figure out what to do. Is there a workaround for this? Something I can do that would work the same way? I've done everything I could think of, including the current date block, but I can't figure out how that block works either, so if someone could help with that, that would be nice, too.
Last edited by BrightCloud33 (March 31, 2024 14:04:04)
- lgrov44
-
Scratcher
500+ posts
Is there a current day of month block?
Well, there are “current month” and “current date” blocks, so with that, you can find the day of month or day and month.
Also, the “current date” block works by telling you, well, the date. The dropdown menu also has year, month, etc. It will tell you that as well. If you are unsure, just check your time and date, then see what the number you get corresponds with.
Also, the “current date” block works by telling you, well, the date. The dropdown menu also has year, month, etc. It will tell you that as well. If you are unsure, just check your time and date, then see what the number you get corresponds with.
- BrightCloud33
-
Scratcher
9 posts
Is there a current day of month block?
What would I enter in the current date block? Like 4/31, March 31, 4/31/24, etc? I'm trying to have something trigger on Easter every year, so I couldn't just put the blocks to make it trigger on any Sunday of March, if you know what I mean. Sorry for all the questions!
- lgrov44
-
Scratcher
500+ posts
Is there a current day of month block?
You would have to enter it independently. The date, then the month, like so:
<<(current [date v]) = [31]> and <(current [month v]) = [3]>>This checks whether it is easter (31st of March).
- BrightCloud33
-
Scratcher
9 posts
Is there a current day of month block?
Oh! Thanks so much!
That helps a lot!
That helps a lot!- lgrov44
-
Scratcher
500+ posts
Is there a current day of month block?
Oh! Thanks so much!You're welcome.That helps a lot!
- deck26
-
Scratcher
1000+ posts
Is there a current day of month block?
current day of week will allow you to detect Sundays but Easter isn't a fixed date or even a fixed Sunday (eg third Sunday) in a month. So triggering on Easter every year is non-trivial. Easter Sunday is actually the first Sunday after the first full moon after the spring equinox. That means it can occur on any of around 4 or 5 Sundays after 21 March depending on the phases of the moon.
You best bet would actually be to do some research and get the date for Easter Sunday for the next 10 years or so and load that into your project.
You best bet would actually be to do some research and get the date for Easter Sunday for the next 10 years or so and load that into your project.
- medians
-
Scratcher
1000+ posts
Is there a current day of month block?
Also, there is year, day of the week (1 = Sunday and 7 = Saturday), hour, minute, and second.
The current block is in the user's timezone, while days since 2000 is always in GMT or UTC (days since 2000 reports the time since January 1, 2000 at 00:00:00)
The current block is in the user's timezone, while days since 2000 is always in GMT or UTC (days since 2000 reports the time since January 1, 2000 at 00:00:00)
Last edited by medians (March 31, 2024 15:01:35)
- Malicondi
-
Scratcher
1000+ posts
Is there a current day of month block?
You would have to enter it independently. The date, then the month, like so:there's an automated method for every easter, rather than this one. Use this:<<(current [date v]) = [31]> and <(current [month v]) = [3]>>This checks whether it is easter (31st of March).
if <<(current [day of the month v]) = (1)>and <<(current [month v]) = (3)> and <(current [date v]) > (24)>>> thendone
say [it's easter!!]
Last edited by Malicondi (March 31, 2024 15:03:14)
- bombardingppl
-
Scratcher
500+ posts
Is there a current day of month block?
if you want to make it so that it triggers every Sunday of march, you could use this
<<(current [month]) = [3]> and <(current [day of week]) = [1]>>
- BrightCloud33
-
Scratcher
9 posts
Is there a current day of month block?
@Igrov44 helped, it's all good now! Thanks to everyone else for trying to help though!
I'll change it if Easter isn't always on the 31, but for now it's working ^^
I'll change it if Easter isn't always on the 31, but for now it's working ^^- Discussion Forums
- » Help with Scripts
-
» Is there a current day of month block?