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

  • BigDaveBigDave Member Posts: 2,239
    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?

  • BigDaveBigDave Member Posts: 2,239

    never mind i took the easy way out

    using game.time only ticking while in the app

  • AdrenalineAdrenaline Member Posts: 523

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

Sign In or Register to comment.