Laravel 5 configure timezone not define the timezone at postgres connection -


i have question: how work on timezone in sites laravel 5?

postgres in localtime , local timezone of notebook in brasilia. application config/app.php set utc database configuration in config/database.php had no specification, passed parameter find config("app.timezone") utc.

then after login print jwt customclaims , timezone of brasilia comes me. [0.o]

running on postgres clilent, hedge timezone utc , make search user data , comes normal. parameter in config/database.php not solving.

any tips?

paste database.php configuration:

https://pastebin.com/uq005tjt

sistema: debian jessie

~$ 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 @                   sat 2017-02-18 23:59:59 -02                   sat 2017-02-18 23:00:00 -03  next dst change: dst begins (the clock jumps 1 hour forward) @                   sat 2017-10-14 23:59:59 -03                   sun 2017-10-15 01:00:00 -02  warning: system configured read rtc time in local time zone.          mode can not supported. create various problems time          zone changes , daylight saving time adjustments. rtc time never updated,          relies on external facilities maintain it. if @ possible, use          rtc in utc calling 'timedatectl set-local-rtc 0' 

config/app.php

/* |-------------------------------------------------------------------------- | application timezone |-------------------------------------------------------------------------- | | here may specify default timezone application, | used php date , date-time functions. have gone | ahead , set sensible default out of box. | */  'timezone' => 'utc',  /* |-------------------------------------------------------------------------- | application locale configuration |-------------------------------------------------------------------------- | | application locale determines default locale used | translation service provider. free set value | of locales supported application. | */  'locale' => 'en', 

config/database.php

<?php      return [          /*         |--------------------------------------------------------------------------         | default database connection name         |--------------------------------------------------------------------------         |         | here may specify of database connections below wish         | use default connection database work. of course         | may use many connections @ once using database library.         |         */          'default' => env('db_connection', 'mysql'),          /*         |--------------------------------------------------------------------------         | database connections         |--------------------------------------------------------------------------         |         | here each of database connections setup application.         | of course, examples of configuring each database platform         | supported laravel shown below make development simple.         |         |         | database work in laravel done through php pdo facilities         | make sure have driver particular database of         | choice installed on machine before begin development.         |         */          'connections' => [              'sqlite' => [                 'driver' => 'sqlite',                 'database' => env('db_database', database_path('database.sqlite')),                 'prefix' => '',             ],              'mysql' => [                 'driver' => 'mysql',                 'host' => env('db_host', '127.0.0.1'),                 'port' => env('db_port', '3306'),                 'database' => env('db_database', 'forge'),                 'username' => env('db_username', 'forge'),                 'password' => env('db_password', ''),                 'charset' => 'utf8mb4',                 'collation' => 'utf8mb4_unicode_ci',                 'prefix' => '',                 'strict' => true,                 'engine' => null,             ],              'pgsql' => [                 'driver' => 'pgsql',                 'host' => env('db_host', '127.0.0.1'),                 'port' => env('db_port', '5432'),                 'database' => env('db_database', 'forge'),                 'username' => env('db_username', 'forge'),                 'password' => env('db_password', ''),                 'charset' => 'utf8',                 'timezone' => config('app.timezone'),                 'locale' => config('app.locale'),                 'prefix' => '',                 'schema' => 'public',                 'sslmode' => 'prefer',             ],          ], 

my timezone authenticated now:

array:1 [   "user" => array:4 [     "id" => 2     "name" => "francis rodrigues"     "email" => "francis-01@tosystems.net"     "last_logged_in_at" => carbon {#236       +"date": "2017-04-07 11:49:48.000000"       +"timezone_type": 1       +"timezone": "-03:00"     }   ] ] 

perhaps have set timezone supported php.

if did not misunderstood, in case, you're trying set timezone brazil.

this should work:

'timezone' => 'america/brasilia' 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -