need some logics or algorithm here:
I want to use javascript to implement a simple counter, which adds rand() int every day (ignoring page loads) and stores that number without using any database... It doesn't have so start from 0, but it has to be increasing everyday. Example: 2050. Next day: 2053..and so on.
I am thinking to use javascript date function, as year is increasing and month numbers are increasing (each year), but days set to 1 each month.. So any ideas what kind of algorithm or javascript function I could use to implement this?
It would be perfect to have rand() function, which increments only, but everyday, not every page load.. Probably it's silly question, but it's Saturday and my brain doesnt function anymore.. :) Thank you so much!
Update: getTime() kinda does the thing, but it gives me smth like 8176870165464, there last digits are miliseconds, so they are changing too often..I need to increment +1 or +3 ( or relatively small int) every day..and the final counter to be 4 digits, smth like 2040, not 345346345355