Local Time difference (even if app is closed)

BigDaveBigDave Member Posts: 2,239
edited May 2017 in Working with GS (Mac)

For this case I do not need a server solution, else I would use app formative.
It has to work without internet. And I want time passed since event x happened.

So I create a time stamp at event x.

201505311227
(y) (m)(d)(m)(sec)
So that it always displays 2 digits for each I do use padInt(x,2)

And compare it to the current

example: 201505311232

201505311232
-201505311227
= 5

This difference I display as a timer in game.
This solution works but if the time is >= 60 (00) its messes up.

I could use game.time but this would not work for time outside the app.

So how would I calculate passed time since event x?

Comments

Sign In or Register to comment.