-2

I'm going to send my timestamp to server and server will check if it is in a given interval. What if My mobile clock is not adjusted (say it gives 2:00 pm while now it is 2:00 am). now I lost the server. How should I handle such a situation.

Ali Amin
  • 103
  • 3

1 Answers1

1

You either need to take system management seriously and use NT, or you could make an extra endpoint on your server poll the server for it's time.

For example, you could send a request to the server and record the request timestamp. The server should respond back with it's timestamp, and then the client can figure out the difference here and adjust your timestamp accordingly.

This way, your data will by in sync with the server minus a few nanoseconds/seconds.

client   ---get timestamp--> SERVER
client   <---137000881---    SERVER
client   -- your request --> SERVER
Mike Mackintosh
  • 284
  • 2
  • 9