也许您正在尝试在Apache的中进行设置
php.ini,但您的CLI(命令行界面)
php.ini不好。
php.ini使用以下命令查找文件:
php -i | grep php.ini
然后搜索
date.timezone并将其设置为
"Europe/Amsterdam"。所有有效的时区都可以在这里找到http://php.net/manual/en/timezones.php
另一种方法(如果其他方法不起作用),搜索文件
AppKernel.php,该文件应在 Symfony
项目目录的文件夹
app下。覆盖该类中的以下函数: __
__construct``AppKernel
<?phpclass AppKernel extends Kernel{ // Other methods and variables // Append this init function below public function __construct($environment, $debug) { date_default_timezone_set( 'Europe/Paris' ); parent::__construct($environment, $debug); }}


