title: Laravel and MySQL timestamp value changes with mysqld configuration
body: <p>I have MySQL and Laravel on my local server, with default configuration and my timezone is GMT+2.  </p>
  
  <h2>Test 1</h2>
  
  <p>I don't touch anything in the MySQL configuration and I try something on my database :</p>
  
  <pre><code>SELECT CURRENT_TIMESTAMP, UTC_TIMESTAMP;
  </code></pre>
  
  <p>Results:</p>
  
  <pre><code>CURRENT_TIMESTAMP       UTC_TIMESTAMP
  2020-06-09 16:34:58     2020-06-09 14:34:58
  </code></pre>
  
  <p>Now, I want to request this raw in Laravel:</p>
  
  <pre><code>id  device_id   lat        lng          alt     at      created_at               updated_at
  1   10          10.000000  10.000000    NULL    NULL    2020-06-09 16:21:55      2020-06-09 16:21:55
  </code></pre>
  
  <p>Here is my test using <code>php artisan tinker</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/gawRr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gawRr.png" alt="TEST 1"></a></p>
  
  <p>It shows 16:34 in UTC (GMT+0).</p>
  
  <h2>Test 2</h2>
  
  <p>Now I try to change the configuration of mysql (in <code>/etc/mysql/mysql.conf.d/mysqld.cnf</code>), and I set this configuration:</p>
  
  <pre><code>default_time_zone='+00:00'
  </code></pre>
  
  <p>I reboot my server:</p>
  
  <pre><code>sudo service mysql restart
  </code></pre>
  
  <p>And then I try again the same test than above:</p>
  
  <pre><code>CURRENT_TIMESTAMP       UTC_TIMESTAMP
  2020-06-09 14:42:46     2020-06-09 14:42:46
  </code></pre>
  
  <p>Now, the raw shows something different (from 16 to 14 hours):</p>
  
  <pre><code>id  device_id   lat        lng          alt     at      created_at               updated_at
  1   10          10.000000  10.000000    NULL    NULL    2020-06-09 14:21:55      2020-06-09 14:21:55
  </code></pre>
  
  <p>And in Laravel:</p>
  
  <p><a href="https://i.stack.imgur.com/etPM9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/etPM9.png" alt="enter image description here"></a></p>
  
  <p>It shows 14:34 in UTC (GMT+0).</p>
  
  <h2>The problem</h2>
  
  <p>I was expecting Laravel/Carbon (or maybe MySQL) to understand that the date is still the same but it looks like it doesn't.<br>
  Also, with the configuration of the <code>Test 1</code>, when a column default to <code>CURRENT_TIMESTAMP</code> Laravel understands it as UTC which is wrong because MySQL will initialize it as GMT+2 (in my case).  </p>
  
  <p>For example, when I execute a <code>INSERT INTO</code> query on a table (outside of Laravel, from Adminer or PhpMyAdmin) which have a timestamp column <code>DEFAULT</code> to <code>CURRENT_TIMESTAMP</code>, MySQL will insert "18:00" as GMT+2 while Laravel will read "18:00" as GMT+0.<br>
  How can I avoid this problem ? Is setting the mysqld parameter as in <code>Test 2</code> is right ?</p>