I have an issue with my code. I have to store all my calendar lunch hours as UTC time. Now converting to my timezone works fine. However when someone looks in the future after daylight saving changes the lunch hours are incorrect and offset by an hour.
$startTime = strtotime($start_date . " UTC");
$endTime = strtotime($end_date . " UTC");
date_default_timezone_set($timeZone);
$calendarWorkHourExceptions->StartDate = date("Y-m-d H:i:s", $startTime);
$calendarWorkHourExceptions->EndDate = date("Y-m-d H:i:s", $endTime);
I also have the date range the user is looking at in the calendar.
If someone would be so kind in helping me I would really appreciate that.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…