Within my chess application, I utilize Firebase.ServerValue.TIMESTAMP
to document the timing of each move.
If a user fails to make a move within 24 hours, they forfeit the game. It is important for me to indicate how much time the user has left to make their move. To achieve this, I must have access to the current unix timestamp and then execute the following calculation:
time left = (last move unix timestamp) + (24 hours) - (current unix timestamp)
Relying on the accuracy of the user's machine time may not be the most reliable approach.
Is there a method to attain the unix timestamp directly from Firebase servers?
Related inquiry