I develop an Android app where the user retrieves from the database server events which are organized. Each event has a date and an hour.
My problem is:
- My server is in Paris and it's 6 pm.
- The user is in New York and it's noon.
The user logs in and retrieves the events planned in New York today. The server gets in database events where the date exceeds the current date. Problem, the server is later in the day than the user, so the user won't see events planned the afternoon.
How can I fix this?
I can get the timezone of the user and of the events but how can I manage? Does the server puts all the dates of the events in the timezone of Paris in database or I let in database the events in local times.
- Ex: An event planned at noon in New York, should I store it with the local timezone (noon) or with the server timezone (6 pm)? And after how works the comparison?
Thank you for your answers.