I'm trying to run new symfony project by symfony new name_project 2.7.21. Unfortunately, I keep having the error for incorrect time zone. I changed it in my C:\xampp\php\php.ini file. Do I have to change it somewhere else? Many thanks for your help
try
add in app/AppKernel.php
public function __construct($environment, $debug)
{
date_default_timezone_set( 'Europe/Warsaw' );
parent::__construct($environment, $debug);
}
I had the same problem with CI system , and that was solution
If your Symfony version is "^4.*" you can set your global timeZone in project/public/index.php
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
date_default_timezone_set( 'Europe/Moscow' );
$request = Request::createFromGlobals();
PHP supported timezone list below
https://www.php.net/manual/en/timezones.europe.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With