Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php IntlDateFormatter在00h00到00h59之间出错_Php_Date_Timezone - Fatal编程技术网

Php IntlDateFormatter在00h00到00h59之间出错

Php IntlDateFormatter在00h00到00h59之间出错,php,date,timezone,Php,Date,Timezone,以下代码显示“2012年10月5日”(这是正确的),但我从00h00执行到00h59时除外。相反,输出为“2012年10月6日” 我是法国人,住在巴黎。我不明白为什么会有变化,以及如何纠正它。 谢谢你帮我 $formatterDMY=new IntlDateFormatter('fr_FR',IntlDateFormatter::LONG,IntlDateFormatter::NONE,'Europe/Paris',IntlDateFormatter::GREGORIAN ); $aDate=n

以下代码显示“2012年10月5日”(这是正确的),但我从00h00执行到00h59时除外。相反,输出为“2012年10月6日”

我是法国人,住在巴黎。我不明白为什么会有变化,以及如何纠正它。 谢谢你帮我

$formatterDMY=new IntlDateFormatter('fr_FR',IntlDateFormatter::LONG,IntlDateFormatter::NONE,'Europe/Paris',IntlDateFormatter::GREGORIAN );
$aDate=new DateTime();
$aDate->setDate(2012, 10, 5);
echo $formatterDMY->format($aDate);

“除非我从中执行它”——然后会发生什么?我们需要搬到法国,等到午夜才意识到这一点吗?你的时区(设置在php.ini中)和时间正确吗?确实^^我编辑了我的问题php.ini中的时区是“UTC”,我用“欧洲/巴黎”替换它,现在可以了:)谢谢Zerkms!