我正在寻找一年中第一天的DateTime修改字符串(现在是2011年1月1日).我尝试了以下方法:
原文链接:https://www.f2er.com/php/138626.html<?PHP $time = new DateTime(); // works as expected,the first day of the current month $time->modify('first day of this month'); echo $time->format('c')."\n"; // this doesn't work. I also tried several other ways $time->modify('first day of january'); echo $time->format('c')."\n"; >