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.
Asked
Active
Viewed 1,034 times
-2
-
4Looks like the end of your question may have been cut off. Could you complete it please? – Xander Jun 30 '14 at 17:40
1 Answers
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
![](../../users/profiles/12327.webp)
Mike Mackintosh
- 284
- 2
- 9