Closed gbowne-quickbase closed 10 months ago
I just noticed similar issue. We have an event feed being used by a vendor and the times are all :00+00:00 but shouldn't they be :00-05:00 since the site is configured for EST?
Sorry for the delay @gbowne-quickbase and @laurabennett.
Calendar is working as intended because it uses Floating Times so that dates/times are always the same. We understand that this will not be desirable for anyone who is looking to offer localized times across the country/world, but there isn't a way around it unfortunately.
How does Calendar handle timezones?
Calendar does not use Timezones. All event date data is stored as UTC+0, and retrieved as UTC+0. So, no matter where you are in the world, an event start date entered at 6pm will be stored and displayed always as 6pm. The calendar.export template query compensates for this by setting the timezone as floating, which (in the current example) means the event will show up at 6pm no matter what timezone the user is located in.
The only place timezones are used is when it checks the current date/time of the currently logged in user, or logged out user. If a user is logged in, Calendar will show/consider today as whichever day it is for that user. If the user is not logged in, Calendar will use the site's current timezone to determine when today is. For example, this is used for highlighting the correct date in a month or week view calendar as Today, or determining which month to show (in the case of last or first day of the month).
https://docs.solspace.com/craft/calendar/v4/setup/faq/#how-does-calendar-handle-timezones
Sorry for the delay @gbowne-quickbase and @laurabennett.
Calendar is working as intended because it uses Floating Times so that dates/times are always the same. We understand that this will not be desirable for anyone who is looking to offer localized times across the country/world, but there isn't a way around it unfortunately.
How does Calendar handle timezones?
Calendar does not use Timezones. All event date data is stored as UTC+0, and retrieved as UTC+0. So, no matter where you are in the world, an event start date entered at 6pm will be stored and displayed always as 6pm. The calendar.export template query compensates for this by setting the timezone as floating, which (in the current example) means the event will show up at 6pm no matter what timezone the user is located in.
The only place timezones are used is when it checks the current date/time of the currently logged in user, or logged out user. If a user is logged in, Calendar will show/consider today as whichever day it is for that user. If the user is not logged in, Calendar will use the site's current timezone to determine when today is. For example, this is used for highlighting the correct date in a month or week view calendar as Today, or determining which month to show (in the case of last or first day of the month).
https://docs.solspace.com/craft/calendar/v4/setup/faq/#how-does-calendar-handle-timezones
Describe the bug or issue you're experiencing We use FeedMe to import events with ISO timestamps, and some are set in other time zones, so the start time reflects the start in that time zone:
StartTime: "2023-12-20T10:00:00+11:00"
which is 10am, but in Sydney, Australia. This imports into the Calendar as 10:00am, although my site has UTC as the system time zone.When we pull it into another section of our site, Craft properly adjusts the time zone to that of the CMS itself, since UTC and Sydney are 11 hours off
Steps to reproduce
Expected behavior Events are all imported into the instance's time zone.
Craft & Plugin Info (please complete the following information):
Additional context