0

We are currently storing events:

  • As single dates Date_from: 2022-11-11 10:00, Date_to: 2022-11-11 11:00)
  • As weekdays (Currently as one database entry) Weekday: Monday, Time_from: 10:00, Time_to: 11:00

We want to add timezone information:

  • Single dates: easy - just convert the datetime to UTC and convert it back when used
  • Weekdays: ??

The questions:

  • How do we handle different timezones with weekdays?
  • Do we store the weekday in UTC? If so, how do we convert a weekday into an UTC weekday?
  • 1
    Your question isn't specific to python/django, so I linked several other questions with good answers about scheduling with respect to time zones. In short - don't convert future information to UTC for storage - even with a single date. Store the information you have about the event in its original form given to you. Dynamically compute the UTC moment to fire the event (or the next occurrence of a recurring event). See answers in the linked duplicates for more details. – Matt Johnson-Pint Nov 14 '22 at 17:23

0 Answers0