我正在寻找一年中第一天的DateTime修改字符串(现在是2011年1月1日).我尝试了以下方法:
<?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"; >