[Solved]Track time since last opening of my game

I need to make a timer that tracks time since I last opened the game and I now have a clock that works and I can write the time for Minutes Seconds and hours into variables, but I need to know how to use modulo 60 to compare the variables for when I last opened it to get the difference.

This is how we make clock. And whenever player clicks close button, store time in storage and after opening calculate time by subtracting current time with previous time.

What i have is a Clock and a function that saves the time once i open the game but the biggest problem is that i cant just do (TimeNow-TimeSaved) because when it for example saves the time 2:30 and it now is 3:10 it will just subtract 30 from 10 giving me a negative number. Same with when it changes the Day e.g:23:00 and 00:10=-23:-10.

Sound like you need to either change the format of your saved date, or you need to convert your times into minutes before getting the difference.

This is what i have

I already changed Write Variable(EntireSec) to Write Variable(EntireSec1)#

t(hour,day etc.) is the time that is now

You’re subtracting the later (bigger) time from the earlier (smaller) time. Use Variable(EntireSec)-Variable(EntireSec1), and you’ll get a positive value.

Thank you all for your contributions i finally fixed it. I just didnt set the variable EntireSec1 to EntireSec when opening the Game. Now it works :slight_smile: