#daily streak

1 messages · Page 1 of 1 (latest)

winter delta
#

Use time get universal seconds and modulo it by 86400

#

I believe this will be day of the year

#

Then just save the output of that to an int variable when they join if the current value+1 =the date

#

Yw

wheat tusk
#

@broken ice

#

You can set a cloud variable to this value at 30hz

#

when the value changes, its been a day

broken ice
blissful goblet
# broken ice What’s the difference between modulo and divide?

Divide (/) finds the number of times one thing can fit in to another. Modulo (%) is the remainder after division. 30 / 4 = 7.5. However: 30 % 4 = 2. Basically, the leftover decimal from division result (0.5), multiplied by the divisor (4) equals the modulo/modulus value (2).

blissful goblet
#

In this particular instance, you want to divide. Why? Because you are attempting to figure out how many days have elapsed since Jan 1, 1970. You are not looking for the remainder of a day left, which is what modulo would provide. 86400 seconds = 60 (seconds in a minute) * 60 (minutes in an hour) * 24 (hours in a day). So you are trying to find out how many 86400 parts (days) fit in the total elapsed time since Jan 1, 1970, therefore you divide.

winter delta
#

Ah ok mb

#

I thought modulo was the same as divide just it didn’t show decimals

#

So like 10.2 would be 10

wheat tusk
#

too bad Modulo isnt real modulo

#

what we have as Modulo is actually Remainder

You know this because mod(-1,5) = -1 and not 4

blissful goblet