#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Local Time difference (even if app is closed)

Posts: 2,239Member
edited May 2017

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?

• Posts: 2,239Member
edited May 2017

maybe if i convert everything into seconds ( definitely need an endless text attribute for this)

201505311232

32
+
12 * 60
+
31 * (24 * 3600)
+
05 * (30 * ((24 * 3600))) = Correct? Whats about variation in month length?

hmmm. Would that already be enough? Where would it glitch here?

• Posts: 2,239Member

never mind i took the easy way out

using game.time only ticking while in the app

• Posts: 523Member

@BigDave you should make alt forum accounts so you can have these one-man thread conversations in character.