@joshp I don‘t really understand. Why doesn’t “02:00:00” exist? It absolutely does. UTC has a 2 AM, just like any other timezone. It doesn’t magically jump from 1 AM to 3 AM.
Dealing with DST when scheduling future events
Hi all, I'm a bit stumped here on the best way to move forward.
I just ran into a DST issue for the first time. We use acuity as a scheduling tool, and pull from its api to populate our db. Just had someone update a start time, which when translated to UTC, is 2021-03-14 02:00:00, so mysql throws a
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘2021-03-14 02:00:00’
As far as the client is concerned, they’ve scheduled for 10pm Chicago time. This should be fine.
in UTC, the 2 o’clock hour doesn’t exist, but the 10 o’clock hour does exist in Chicago time.
How does one account for such issues?
In the end, this SO Q/A was exactly my situation. Short version:
Add the timezone option to the database config
'mysql' => [
// ...
'timezone' => '+00:00'
],
The question is also quite well written, and describes the issue I was having much better than I did.
Please or to participate in this conversation.