I need to get date of 10th day of current month. This way is not working:
<?php
$date_start = new DateTime();
$date_start->modify('tenth day of this month');
echo $date_start->format('Y-m-d H:i:s'), "\n";
?>
Results:
Warning: DateTime::modify(): Failed to parse time string (tenth day of this month ) at position 10 (o): The timezone could not be found in the database in [...][...] on line 3
Of cource, I can use date('Y-m-10')
but I need to make it with DateTime() object.