search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Time isn't sync when multiple clients at different time zone

Asked by Anonymous
1 month ago.

When an event-1 is created from the client-1, the local date and time in yyyy-MM-ddTHH:mm:ss format is sent to the server database. When the client-2 at different time zone fetches the events from the server database and renders directly on the calender view.

What is the best way to handle when multiple clients at different time zone

  • Maintain the server time as GMT

  • Convert local to GMT before the time is sent to server (onTimeRangeSelected)

  • Convert GMT to local time before it is render into the calender view (onBeforeEventRender)

Answer posted by Dan Letecky [DayPilot]
1 month ago.

I recommend the following approach:

  • For the database, use GMT value.

  • Assign the desired time zone to each user.

  • When sending the data from the server (when displaying data) or to the server (recording changes), convert the dates to/from the user time zone. Do this on the server and send the data in ISO 8601 format without the timezone specifier.

Just note that the timezone handling depends on scale that you use.

  • For hour-level data, you will want to convert the time as described above.

  • When displaying day-level data, you may store only the date part without performing any conversions.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.