DateTime::setISODate()

It sets the ISO date .
Example

<?php
$date = new DateTime();
$date->setISODate(2007, 7);
echo $date->format(‘Y-m-d’) ;
?>

Output

2007-02-12

Share