Skip to content

PollService.php: To/From all-day slots add/substract the timezone offset, so that the correct day gets displayed.

PollService.php: To/From all-day slots add/substract the timezone offset, so that the correct day gets displayed.

All-day events start at timezone/local time 00:00am. The timestamps in the database are stored as non-UTC datetime values, e.g. if created in TZ Europe/Berlin, an all-day slot's timestamp points to 11:00pm (CET) and 10:00pm (CEST) of the day before the day referenced by the slot. This leads to all-day events happening e.g. on Saturday being displayed as all-day events on Friday (etc.).

To work around this, we take the php.ini date.timezone value and add the timezone offset to the database timestamp to retrieve the meant time-of-day (00:00am). This assumes that all users' timezones settings are to date_default_timezone_get().

However, the better approach probably is to store all-day events as UTC 00:00am timestamps in the database.

Merge request reports