Eyal
Eyal

Reputation: 10828

Best practice for dealing with different client time zones?

I'm building an iPhone chat app, that uses a central server. What is the best practice for dealing with different clients time zones?

I mean when client1 sends a message to client2, the server save the message in his database with timestamp according to the servers time zone, that could be different from client1 time zone and client2 time zone..
So how do I manage this so when client2 get the message he will know how to convert it to its time zone, or maybe the server will do the converting??

Upvotes: 0

Views: 612

Answers (1)

ysrb
ysrb

Reputation: 6740

First you need to store the time as UTC. Then when displayed, you need to detect the timezone and it will add/minus.

Upvotes: 1

Related Questions