N
NoFontNL
Guest
Hi all, how would I get a 24 hour reward system?
I know what I should do. Save current time als savedTime. If newtime is 24h bigger than savedTime then canCollect=true. But I have trouble with saving time and calculating the new time.
I can't get it right. Any help is appreciated.
#1 | How would I save the current time? (day, hour, minute, second);
- I had in mind with current_day, current_hour, current_minute, current_second.
#2 | How can I check if the new time is 24h bigger than the savedTime?
- I think I could do this with savedDay - current_day;
savedHour - current_hour etc. but I think it'll get pretty hard because of it's for example now 13.00h and the savedHour is 9.00h then it'll end up with -4.00h.
------------------------------------------------------------------------------------------------------
Thanks in advance!
I know what I should do. Save current time als savedTime. If newtime is 24h bigger than savedTime then canCollect=true. But I have trouble with saving time and calculating the new time.
I can't get it right. Any help is appreciated.
#1 | How would I save the current time? (day, hour, minute, second);
- I had in mind with current_day, current_hour, current_minute, current_second.
#2 | How can I check if the new time is 24h bigger than the savedTime?
- I think I could do this with savedDay - current_day;
savedHour - current_hour etc. but I think it'll get pretty hard because of it's for example now 13.00h and the savedHour is 9.00h then it'll end up with -4.00h.
------------------------------------------------------------------------------------------------------
Thanks in advance!