title: Laravel 5 configure timezone not define the timezone at postgres connection
body: <p>I have a question: How you usually work on timezone in the sites with laravel 5?</p>
  
  <p>Postgres is in localtime and the local timezone of my notebook is in Brasilia. But the application is with the <code>config/app.php</code> set to UTC but the database configuration in <code>config/database.php</code> had no specification, so I passed the parameter to find <code>config("app.timezone")</code> which is <code>UTC</code>.</p>
  
  <p>Then after login I print the <code>JWT CustomClaims</code> and the timezone of Brasilia comes to me. [0.o]</p>
  
  <p>Running on the postgres clilent, I hedge the timezone to UTC and make the search for user data and it comes to normal. So this parameter in <code>config/database.php</code> is not solving.</p>
  
  <p>Any tips?</p>
  
  <p>Paste with the database.php configuration:</p>
  
  <p><a href="https://pastebin.com/Uq005TjT" rel="nofollow noreferrer">https://pastebin.com/Uq005TjT</a></p>
  
  <p>Sistema: Debian Jessie</p>
  
  <pre><code>~$ timedatectl
  
      tosystems@debian:~$ timedatectl
        Local time: Thu 2017-04-06 21:16:55 -03
    Universal time: Fri 2017-04-07 00:16:55 UTC
          RTC time: Thu 2017-04-06 21:16:56
         Time zone: America/Sao_Paulo (-03, -0300)
       NTP enabled: yes
  NTP synchronized: no
   RTC in local TZ: yes
        DST active: no
   Last DST change: DST ended at
                    Sat 2017-02-18 23:59:59 -02
                    Sat 2017-02-18 23:00:00 -03
   Next DST change: DST begins (the clock jumps one hour forward) at
                    Sat 2017-10-14 23:59:59 -03
                    Sun 2017-10-15 01:00:00 -02
  
  Warning: The system is configured to read the RTC time in the local time zone. This
           mode can not be fully supported. It will create various problems with time
           zone changes and daylight saving time adjustments. The RTC time is never updated,
           it relies on external facilities to maintain it. If at all possible, use
           RTC in UTC by calling 'timedatectl set-local-rtc 0'
  </code></pre>
  
  <p>config/app.php</p>
  
  <pre><code>/*
  |--------------------------------------------------------------------------
  | Application Timezone
  |--------------------------------------------------------------------------
  |
  | Here you may specify the default timezone for your application, which
  | will be used by the PHP date and date-time functions. We have gone
  | ahead and set this to a sensible default for you out of the box.
  |
  */
  
  'timezone' =&gt; 'UTC',
  
  /*
  |--------------------------------------------------------------------------
  | Application Locale Configuration
  |--------------------------------------------------------------------------
  |
  | The application locale determines the default locale that will be used
  | by the translation service provider. You are free to set this value
  | to any of the locales which will be supported by the application.
  |
  */
  
  'locale' =&gt; 'en',
  </code></pre>
  
  <p>config/database.php</p>
  
  <pre><code>&lt;?php
  
      return [
  
          /*
          |--------------------------------------------------------------------------
          | Default Database Connection Name
          |--------------------------------------------------------------------------
          |
          | Here you may specify which of the database connections below you wish
          | to use as your default connection for all database work. Of course
          | you may use many connections at once using the Database library.
          |
          */
  
          'default' =&gt; env('DB_CONNECTION', 'mysql'),
  
          /*
          |--------------------------------------------------------------------------
          | Database Connections
          |--------------------------------------------------------------------------
          |
          | Here are each of the database connections setup for your application.
          | Of course, examples of configuring each database platform that is
          | supported by Laravel is shown below to make development simple.
          |
          |
          | All database work in Laravel is done through the PHP PDO facilities
          | so make sure you have the driver for your particular database of
          | choice installed on your machine before you begin development.
          |
          */
  
          'connections' =&gt; [
  
              'sqlite' =&gt; [
                  'driver' =&gt; 'sqlite',
                  'database' =&gt; env('DB_DATABASE', database_path('database.sqlite')),
                  'prefix' =&gt; '',
              ],
  
              'mysql' =&gt; [
                  'driver' =&gt; 'mysql',
                  'host' =&gt; env('DB_HOST', '127.0.0.1'),
                  'port' =&gt; env('DB_PORT', '3306'),
                  'database' =&gt; env('DB_DATABASE', 'forge'),
                  'username' =&gt; env('DB_USERNAME', 'forge'),
                  'password' =&gt; env('DB_PASSWORD', ''),
                  'charset' =&gt; 'utf8mb4',
                  'collation' =&gt; 'utf8mb4_unicode_ci',
                  'prefix' =&gt; '',
                  'strict' =&gt; true,
                  'engine' =&gt; null,
              ],
  
              'pgsql' =&gt; [
                  'driver' =&gt; 'pgsql',
                  'host' =&gt; env('DB_HOST', '127.0.0.1'),
                  'port' =&gt; env('DB_PORT', '5432'),
                  'database' =&gt; env('DB_DATABASE', 'forge'),
                  'username' =&gt; env('DB_USERNAME', 'forge'),
                  'password' =&gt; env('DB_PASSWORD', ''),
                  'charset' =&gt; 'utf8',
                  'timezone' =&gt; config('app.timezone'),
                  'locale' =&gt; config('app.locale'),
                  'prefix' =&gt; '',
                  'schema' =&gt; 'public',
                  'sslmode' =&gt; 'prefer',
              ],
  
          ],
  </code></pre>
  
  <p>My timezone authenticated now:</p>
  
  <pre><code>array:1 [
    "user" =&gt; array:4 [
      "id" =&gt; 2
      "name" =&gt; "Francis Rodrigues"
      "email" =&gt; "francis-01@tosystems.net"
      "last_logged_in_at" =&gt; Carbon {#236
        +"date": "2017-04-07 11:49:48.000000"
        +"timezone_type": 1
        +"timezone": "-03:00"
      }
    ]
  ]
  </code></pre>