$originalDate1 = '2013-12-30';
echo $newDate = date("o-m-d", strtotime($originalDate1));
显示 2014 而不是 2013
问题是"o"
ISO-8601年号。此值与 Y 相同,不同之处在于,如果 ISO 周数 (W) 属于上一年或下一年,则改用该年份。(在 PHP 5.1.0 中新增)
您应该改用"Y"。
使用 Y-m-d
而不是 o-m-d
$originalDate1 = '2013-12-30';
echo $newDate = date("Y-m-d", strtotime($originalDate1)); // will output 2014-12-30