I want to count how many day passed. I know Ejectjs date but I couldn't figure out how to use it to substract my start date.
if anybody have idea to make it, I really appreciate, thank you.
You'll have to use this plugin to get the date:
on the start date save the UnixTimestamp (seconds since Jan 1, 1970) to webstorage for later, we'll call this start_time.
Then any following times you want to see how many days have passed you retrieve the saved time from webstorage and subtract the current UnixTimestamp. That will give you the number of seconds from one date to another. Divide by 60 to get minutes, 60 again to get hours, and finally also by 24 to get days.
days = (start_time - UnixTimestamp)/60/60/24
Develop games in your browser. Powerful, performant & highly capable.
R0J0hound you are AWSOME! I did it
Like this : floor(UnixTimestamp-start_time)/1000/60/60/24)
Thank you! I was searching for like 1 hour.
And rexrainbow thank you for the plugin!
Opps... I see I had the subtraction reversed. :p Glad you got it working.