title: Laravel SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2019-03-10 02:00:39' for column 'updated_at' (daylight savings?)
body: <p>I'm working on a Laravel application with a queue worker, and it just started failing and throwing a constant stream of exceptions to the log. Here is one of them:</p>
  <pre><code>SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2019-03-10 02:00:39' for column 'updated_at' at row 1 (SQL: update `videos` set `updated_at` = 2019-03-10 02:00:39 where `id` = 30860) 
  </code></pre>
  <p>A few things to note:</p>
  <ul>
  <li>The timestamp <em>appears</em> to be the correct format</li>
  <li>The column is a MySQL TIMESTAMP type (nullable), using InnoDB</li>
  <li>The <code>updated_at</code> field is managed by Laravel defaults, with nothing custom happening for the date formatting</li>
  <li>I'm not using any date mutators, or anything that would be changing the value before save</li>
  <li>This code has been running for weeks without any issue</li>
  <li>No code has changed recently</li>
  <li>I did a <code>git checkout .</code> and <code>composer install</code> to make sure none of the library files had changed or been corrupted somehow (no change)</li>
  <li><strong>The error first appeared at <code>2019-03-10 02:00:39</code> (UTC), which is 8pm local (Central) time</strong></li>
  </ul>
  <blockquote>
  <p>Daylight saving time 2019 in Minnesota will begin at 2:00 AM on
  Sunday, March 10</p>
  <p>-- Google</p>
  </blockquote>
  <p>Everything I can find on google is related to somebody using a blatantly wrong time format, so that hasn't helped me figure it out.</p>
  <p>I feel like there is too much of a coincidence between the errors starting at 02:00 <em>UTC</em> on the same day when daylight savings is supposed to begin at 02:00 <em>US Central Time</em>, but I don't have a clue why it would be throwing this error when timestamps are managed by the framework and converted to UTC before saving (and UTC doesn't change for daylight savings).</p>
  <p>MySQL 5.5.45<br>
  Laravel 5.7.28<br>
  nesbot/carbon 1.36.2<br>
  PHP 7.2.7</p>
  <p>config/database.php:</p>
  <pre><code>'mysql' =&gt; [
      
      'charset' =&gt; 'utf8',
      'collation' =&gt; 'utf8_unicode_ci',
      'prefix' =&gt; '',
      'strict' =&gt; true,
      'engine' =&gt; null,
  ],
  </code></pre>
  <p>What could be causing the date value to be recognized as invalid?</p>
  <p><strong>Edit:</strong> I've determined this is definitely a daylight savings error, as clocks skip forward 1 hour and times between 02:00 and 03:00 are invalid in US Central Time. What I don't understand is why a TIMESTAMP field on an application set to UTC would be throwing an error? How can UTC be affected by daylight savings, and what can I do to prevent this when the timestamp is managed by the framework (Laravel+Carbon)?</p>