In my chess app I use Firebase.ServerValue.TIMESTAMP
to record the time of a move.
Suppose that user has 24 hours to make a move. If they do not make a move within 24 hours, they lose the game.
I would like to display how much time user has left to make a move. To calculate this, I need to know the current unix timestamp, and then I would do:
time left = (last move unix timestamp) + (24 hours) - (current unix timestamp)
I feel like assuming that user's machine time is correct might not be the best idea.
Is there a way to get the unix timestamp from Firebase servers?