Я ищу модификацию строки DateTime для первого дня года (теперь 1. января 2011).Я попробовал следующее:
<?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";
>
Я знаю, что есть другие способы получения даты, но я ищу строку DateTime-> modify (), другого решения нет.