Discuss Scratch

Sinaboo
Scratcher
100+ posts

Days since a certain day script

I've been trying to make it so a script would subtract a date in the past from the current date using the current date block but couldn't find out how. Is it even possible to make a script that does that? Thanks in advance.
-ShadowOfTheFuture-
Scratcher
1000+ posts

Days since a certain day script

You could do this…

((days since 2000) - (# of days between January 1st, 2000 and the date you want))

<Insert uncreative signature here>









██       ██  ██            ██  ██       ██
██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██
███ ███ ██ ████ ██ ███ ███
█████████ █████ █████ █████████

“Though the seasons come and go, and sunshine turns to snow, we will always have tomorrow up ahead.”
Sinaboo
Scratcher
100+ posts

Days since a certain day script

-ShadowOfTheFuture- wrote:

You could do this…

((days since 2000) - (# of days between January 1st, 2000 and the date you want))
Could you elaborate on the part with the variables? I'm not understanding why there's a comma and the “and” part near the end.
Sinaboo
Scratcher
100+ posts

Days since a certain day script

Never mind I think I made something similar that might work
Sinaboo
Scratcher
100+ posts

Days since a certain day script

Actually I don't. Is there any way you could help?
georgeskey
Scratcher
100+ posts

Days since a certain day script

define days since year (year) day of year (day)
set [return v] to (round((days since 2000)+((730000)-(((365)*(year))+(day)))))
Examples of use:
days since year (2018) day of year (1) ::custom
would show the days since January first, 2018 while
days since year (2018) day of year (357)::custom
would show the number of days since the date of me writing this post.
In case you can't see the order of the scratchblocks, here's the equation:
round((days since 2000)+((730000)-(((365)*(year))+(day))))

This is essentially just an automated version of what -ShadowOfTheFuture- said.

Last edited by georgeskey (Dec. 19, 2018 00:58:58)


Apparently my old signature was lost::custom hat
Oh well, I guess this will do ::custom cap
DestroyerMCE
Scratcher
34 posts

Days since a certain day script

-ShadowOfTheFuture- wrote:

You could do this…

((days since 2000) - (# of days between January 1st, 2000 and the date you want))
((days since 2000) - (days between NYD *2000 and date of your choosing))
*2000 was a leap year, and so was 2004, 2008, etc.
Use https://planetcalc.com/274/

Last edited by DestroyerMCE (Dec. 19, 2018 02:16:45)


if <[asking for help] = [true]> then
say [please link your project]
end

Powered by DjangoBB