如果运行以下代码
<?php
$date = new DateTime('2019-12-30 19:45:00', new DateTimeZone('Europe/London'));
$formatter = new IntlDateFormatter(
'en_GB',
null,
null,
'Europe/London',
IntlDateFormatter::GREGORIAN,
'MMMM YYYY'
);
echo $formatter->format($date);它会回音December 2020。这是类中的一个bug,还是我犯了错误,因为我希望它返回December 2019
发布于 2019-11-30 10:14:39
根据:http://userguide.icu-project.org/formatparse/datetime
Y代表“一年中的每一周”(不管它的意思是什么),y是我们习惯的常年引用。因此,要获得当前年份,将YYYY替换为yyyy,它应该完成以下工作
https://stackoverflow.com/questions/59115111
复制相似问题