简体   繁体   English

如何解决Php date()错误

[英]How to solve Php date() error

print date("F d,o",strtotime("1974-12-31"));

print December 31, 1975 instead of December 31 1974 ? 打印December 31, 1975 December 31 1974而不是December 31 1974

Im using php version 5.2.9-2 我使用PHP版本5.2.9-2

The 'o' is the ISO year. 'o'是ISO年份。 The ISO year is based on the year the biggest part of the week belongs to. ISO年份基于本周最大部分所属的年份。 In 1974, december 31st was the tuesday of week 1 of 1975. 1974年12月31日是1975年第1周的星期二。

You probably want 'Y'. 你可能想要'Y'。

这应该工作:

print date("F d,Y",strtotime("1974-12-31"));

Mabey try using 'Y' insted of 'o' Mabey尝试使用'Y'插入'o'

date("F d,Y",strtotime("1974-12-31")); 日期(“F d,Y”,strtotime(“1974-12-31”));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM