You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
All event times treated as UTC even though timezone set differently #133
Thanks for a very useful addon, I'm just configuring it now.
I have one issue to figure out before I go live... and I'm sorry to report that it's (of course) related to timezones !
In my blueprint I have imported your events:event fieldset, including the timezone field.
My server time is set to UTC.
On my test event though, I'm setting the timezone to Europe/London, which is currently on BST (+1 hour from UTC).
I set the start time of the event to 10:00.
If I then display the Start Time in the view with the timezone: {{ start_time | format:'H:i T' }} it displays "10:00 UTC"
So the time field itself isn't reflecting the timezone, and is just (probably) using the server timezone.
If I print out the timezone field to the view, via the {{ timezone | raw }} variable, it shows as "Europe/London"
After a tip from Ryan in Discord I looked at the Statamic Timezone Modifier, but that would actually change the time displayed too, so it would display as "11:00 BST"
I wonder if this issue I'm having could be related to #121 - or am I simply doing something wrong, or misunderstanding the whole thing?
Chatted this through with @edalzell today and here's what we've found...
The start_date, start_time, end_date, end_time fields are not timezone aware. So when they are stored and recalled they are just assumed to be in the server timezone.
Therefore when rendering them in the view, a start time which has 10:00 stored in it, when output formatted as:
{{ start_time | format('H:i T') }}
Will always show as 10:00 UTC if the server timezone is set to UTC - even if the timezone on the event is set as Europe/London or elsewhere.
That then also extends to the calendar downloads, meaning the times will show incorrectly on people's calendars.
Within the events addon there is a further 'start' variable which then take the start_date, start_time and timezone and creates a Carbon value with the timezone correctly implemented.
This could then display timezone aware date/times with {{ start | format('l, jS F Y H:i T') }}
However due to #134 this variable isn't available on views.
In addition to resolving that issue, though, could the base start_date and start_time fields be adapted to be timezone aware, based on the timezone in the timezone field?
That would then solve the related issue that the calendar downloads have incorrect times because of assuming all times are in the server timezone.
This effectively does the same as the start variable, and so shows that the approach to using Carbon to add the timezone field to the date/time data when creating the variables works.
For another workaround, I've reproduced the way start() and end() are built in my EventsCalendarController for creating the google/outlook calendar links with Spatie Calendar Links:
And that has worked to mean calendar downloads now have the correct times and timezones, and can be localised by the calendar app for the users own timezone
Chatted this through with @edalzell today and here's what we've found...
The start_date, start_time, end_date, end_time fields are not timezone aware. So when they are stored and recalled they are just assumed to be in the server timezone.
This is correct, start_date is a raw date, and start_time time is a raw string and will use the server timezone.
If you want timezone aware start/end, use the start and end variables.
For another workaround, I've reproduced the way start() and end() are built in my EventsCalendarController for creating the google/outlook calendar links with Spatie Calendar Links:
Events includes a download tag to make these links.
Also, use start and end variables that are available on the data.
Activity
steveparks commentedon Sep 26, 2025
How to reproduce.
{{ start_time | format:'H:i T' }}steveparks commentedon Oct 2, 2025
Chatted this through with @edalzell today and here's what we've found...
The start_date, start_time, end_date, end_time fields are not timezone aware. So when they are stored and recalled they are just assumed to be in the server timezone.
Therefore when rendering them in the view, a start time which has 10:00 stored in it, when output formatted as:
{{ start_time | format('H:i T') }}Will always show as 10:00 UTC if the server timezone is set to UTC - even if the timezone on the event is set as Europe/London or elsewhere.
That then also extends to the calendar downloads, meaning the times will show incorrectly on people's calendars.
steveparks commentedon Oct 2, 2025
Within the events addon there is a further 'start' variable which then take the start_date, start_time and timezone and creates a Carbon value with the timezone correctly implemented.
This could then display timezone aware date/times with
{{ start | format('l, jS F Y H:i T') }}However due to #134 this variable isn't available on views.
In addition to resolving that issue, though, could the base start_date and start_time fields be adapted to be timezone aware, based on the timezone in the timezone field?
That would then solve the related issue that the calendar downloads have incorrect times because of assuming all times are in the server timezone.
steveparks commentedon Oct 2, 2025
In the meantime, this is a workaround for displaying times on the event views in the correct timezone as set in the entry timezone field:
This effectively does the same as the
startvariable, and so shows that the approach to using Carbon to add the timezone field to the date/time data when creating the variables works.steveparks commentedon Oct 4, 2025
For another workaround, I've reproduced the way start() and end() are built in my EventsCalendarController for creating the google/outlook calendar links with Spatie Calendar Links:
And that has worked to mean calendar downloads now have the correct times and timezones, and can be localised by the calendar app for the users own timezone
edalzell commentedon Feb 6, 2026
This is correct,
start_dateis a raw date, andstart_timetime is a raw string and will use the server timezone.If you want timezone aware start/end, use the
startandendvariables.edalzell commentedon Feb 6, 2026
Events includes a
downloadtag to make these links.Also, use
startandendvariables that are available on the data.