- Posts: 146
- Thank you received: 11
Recurring times wrong with Daylight savings
- Stephan Hodges
- Topic Author
- Offline
- Premium Member
-
Less
More
11 years 1 week ago #60205
by Stephan Hodges
Recurring times wrong with Daylight savings was created by Stephan Hodges
US follows "Daylight Savings" times, which mean that the clock time changes by 1 hour twice a year.
Unfortunately, it appears that recurring events are probably saved as offsets of UTC (Universal Coordinated Time) [The UTC ordering in the name is because it's using the French word order]
This means that a recurring event which was started before daylight savings time (DST) but repeats AFTER DST is in effect has the wrong start and end times.
For 2015, DST started Sunday 8 March (1 hour forward), and ends 1 November (1 hour backward).
A class that repeats for 6 weeks, starting at 6:00pm comes out showing as if it starts at 7:00pm after March 8th, assuming it was created before the 8th of March.
I have one event that was scheduled at the beginning of the year, every week until the end of the year.
Since it's not possible to set filters by date (which I've suggested in the past), is there any easy way to fix these times? Perhaps an SQL script?
Unfortunately, it appears that recurring events are probably saved as offsets of UTC (Universal Coordinated Time) [The UTC ordering in the name is because it's using the French word order]
This means that a recurring event which was started before daylight savings time (DST) but repeats AFTER DST is in effect has the wrong start and end times.
For 2015, DST started Sunday 8 March (1 hour forward), and ends 1 November (1 hour backward).
A class that repeats for 6 weeks, starting at 6:00pm comes out showing as if it starts at 7:00pm after March 8th, assuming it was created before the 8th of March.
I have one event that was scheduled at the beginning of the year, every week until the end of the year.
Since it's not possible to set filters by date (which I've suggested in the past), is there any easy way to fix these times? Perhaps an SQL script?
Please Log in or Create an account to join the conversation.
- Stephan Hodges
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 146
- Thank you received: 11
11 years 1 week ago - 11 years 1 week ago #60213
by Stephan Hodges
Replied by Stephan Hodges on topic Recurring times wrong with Daylight savings
Looking at the database, the times display as local time. I've used some SQL to fix some of them, but I didn't know how to select only child events whose parents were created in a different savings time.
To subtract an hour from an event time, this code works:
To subtract an hour from an event time, this code works:
Code:
`event_date` = DATE_ADD(`event_date`, INTERVAL -1 HOUR),
Last edit: 11 years 1 week ago by Stephan Hodges. Reason: Fix code tag
Please Log in or Create an account to join the conversation.
- James Riley
-
- Offline
- Platinum Member
-
11 years 1 week ago - 11 years 1 week ago #60216
by James Riley
James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Replied by James Riley on topic Recurring times wrong with Daylight savings
There may need to be a PER-EVENT config option to compensate or not compensate for DST. In the off-chance that someone is using EB for reoccurring events at venues both in a DST-observing region and a non-DST-observing region -- eg. a venue in Maidstone, Saskatchewan, Canada (they do DST) and a venue 25km away in Payton, Saskatchewan, Canada (they do not do DST -- same time year round). I think think it'll be a rare case (eg. could effect national tours that occur over the DST change dates in regions where DST does not happen -- eg. Arizona USA or most of Saskatchewan CANADA -- , or local regional events that happen in neighboring towns that happen to be in different DST regions), but it would certainly create problems for reoccurring events. Without a per-event option, users will have to do a manual time change in the DB to compensate. You unfortunately can't static-assign based on the state/province selected -- as in my example above, some regions (like Saskatchewan) are split between DST-observing and non-DST, and some regions (like Nunavut, Canada, one of the northern 'territory' provinces) span three different DST-observing time zones.
James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 11 years 1 week ago by James Riley.
Please Log in or Create an account to join the conversation.
- Stephan Hodges
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 146
- Thank you received: 11
11 years 1 week ago #60235
by Stephan Hodges
Replied by Stephan Hodges on topic Recurring times wrong with Daylight savings
I think it can be simplified, and should be easy to implement.
There are two cases: a) The time should stay the same (i.e. 7:00pm class) regardless of savings time or not and b) the time follows savings time (i.e. a global teleconference event)
In the first case, the "7:00 pm" time should always be applied.
The second case could be implemented in a number of ways, but I don't think it needs a per event option, but just a single option. When using this second case, a second time field (hidden) could save the adjusted UTC (Universal) time, and then the display code (Calendars, Event detail, etc) would always convert to the local browser's time. That should automatically handle the savings time issue as well.
There are two cases: a) The time should stay the same (i.e. 7:00pm class) regardless of savings time or not and b) the time follows savings time (i.e. a global teleconference event)
In the first case, the "7:00 pm" time should always be applied.
The second case could be implemented in a number of ways, but I don't think it needs a per event option, but just a single option. When using this second case, a second time field (hidden) could save the adjusted UTC (Universal) time, and then the display code (Calendars, Event detail, etc) would always convert to the local browser's time. That should automatically handle the savings time issue as well.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
11 years 1 week ago #60237
by Tuan Pham Ngoc
I think you can use the SQL command:
Note :
#__eb_events need to be replaced with actual table
FROM_DATE needs to be replaced with the start date when time start changing
TO_DATE needs to be replaced with the end date when time stops changing
BTW, these events are created based on what version of Events Booking ? If it is from version 1.6.9+ and PHP version on your server greater than 5.3.x, then this should be handled properly(without having to fix)
Tuan
Replied by Tuan Pham Ngoc on topic Recurring times wrong with Daylight savings
Stephan Hodges wrote: Looking at the database, the times display as local time. I've used some SQL to fix some of them, but I didn't know how to select only child events whose parents were created in a different savings time.
To subtract an hour from an event time, this code works:Code:`event_date` = DATE_ADD(`event_date`, INTERVAL -1 HOUR),
I think you can use the SQL command:
Code:
UPDATE #__eb_events SET `event_date` = DATE_ADD(`event_date`, INTERVAL -1 HOUR) WHERE parent_id > 0 and (event_date BETWEEN 'FROM_DATE' AND 'TO_DATE')
Note :
#__eb_events need to be replaced with actual table
FROM_DATE needs to be replaced with the start date when time start changing
TO_DATE needs to be replaced with the end date when time stops changing
BTW, these events are created based on what version of Events Booking ? If it is from version 1.6.9+ and PHP version on your server greater than 5.3.x, then this should be handled properly(without having to fix)
Tuan
The following user(s) said Thank You: Stephan Hodges
Please Log in or Create an account to join the conversation.
- Stephan Hodges
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 146
- Thank you received: 11
11 years 1 week ago #60238
by Stephan Hodges
Replied by Stephan Hodges on topic Recurring times wrong with Daylight savings
Thanks very much! I had some of the SQL but that should do it.
Also, of note, I always write a "SELECT" with the where clause first to see the rows that would be affected.
I currently have EB 1.6.10 (current version), and did create the events with it, so not sure what happened.
If you had an online demo/test site, I could try and duplicate it for you.
Again, thanks!
Also, of note, I always write a "SELECT" with the where clause first to see the rows that would be affected.
I currently have EB 1.6.10 (current version), and did create the events with it, so not sure what happened.
If you had an online demo/test site, I could try and duplicate it for you.
Again, thanks!
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2026 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.