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:
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.
Thank you for your answers.
I would recommend converting your server to store/load data in UTC and also for your client to use UTC time in the background. This will help ensure that they are both using the same time zone for comparison.
This is usually the recommended approach since UTC is the standard and will never be affected by daylight savings time.