(Redirected from Days Since 2000)

Days Since 2000
days since 2000
Category Sensing
Type Reporter
Introduced in v148 (2.0 alpha)
v230 (2.0 beta)
Removed in v172 (2.0 alpha)

The Days Since 2000 block is a Sensing block and a reporter block. It reports the amount of days (and fractions of a day) since 00:00:00 1 January 2000 (UTC). It was replaced by Scratch Days in v172, but replaced Scratch Days in v230 of the 2.0 beta, and Scratch Days did not make the official release of 2.0.

It is one of the two date/time blocks in Scratch. The other is current (), which reports the date or time. Both these blocks can be worked in unison with one another for a variety of time-related scripts and projects.

Example Uses

This block can be used in some of the following ways:

  • Making a countdown
say (join ((9132) - (days since 2000)) [ days till 2025!])
  • Making something unavailable before or after a certain date
if <(days since 2000) < (5845)> then
  change [money v] by [1000]
else
  say [This feature is unavailable after January 1, 2016.]
end
  • Finding the number of days since 00:00:00 1 January (UTC) on a certain year
((days since 2000) - (((year) - (2000)) * (365)))
  • Corresponding real-life events with projects
define mark (event) for (value) days from now
add ((days since 2000) + (value)) to [eventDates v]
add (event) to [eventNames v]

define search calendar for (event)
set [i v] to (0)
repeat until <<(i) > (length of [eventNames v])> or <(item (i) of [eventNames v]) = (event)>>
change [i v] by (1)
end
if <(i) > (length of [eventNames v])> then
set [output v] to (join (join [Your search for ] (event)) [ was not found.])
else
if <(days since 2000) < (item (i) of [eventDates v])> then
set [output v] to (join (join (join (join [Your event ] (event)) [ is in ]) ((item (i) of [eventDates v]) - (days since 2000))) [ days])
else
if <(days since 2000) = (item (i) of [eventDates v])> then
set [output v] to (join (event) [ is today!])
else
set [output v] to (join (join [This event happened ] ((days since 2000) - (item (i) of [eventDates v]))) [ days ago.])
end
end
end
Main article: Making an FPS Counter
define Calculate DeltaTime and FPS (last frame) (reg fps)
wait (0) seconds //this block is used to wait one frame since when the function was called
set [DeltaTime v] to(((reg fps)*(86400))*((days since 2000)-(last frame)))
set [FPS v] to (round((reg fps)/(DeltaTime)))


when flag clicked
forever
Calculate DeltaTime and FPS (days since 2000) (30)
end

Controversy

Many users have questioned the usefulness of this block and what it is for.[1][2][3] Many users have also suggested the block to be replaced with a (days since ():: sensing) block.[4][5][6][7][8] The block is often used for countdowns and clocks, [9] so other users have also said that this block is useful and should not be removed.[10]

See Also

References

Cookies help us deliver our services. By using our services, you agree to our use of cookies.