This seems to work for me:
<?php
$first_tuesday = new DateTime("first Tuesday of January 2011");
echo $first_tuesday->format('Y-m-d H:i:s');
?>
Putting it into functional form:
<?php
/**
* @return DateTime Returns a DateTime object representing the
* first Tuesday of the year
*/
function first_tuesday($year){
$first_tuesday = new DateTime("first Tuesday of January $year");
return $first_tuesday;
}
?>
If you just want the string in your format, then:
<?php
/**
* @return DateTime Returns a string representing the first
* Tuesday of the year in the d/m/Y format
*/
function first_tuesday($year){
$first_tuesday = new DateTime("first Tuesday of January $year");
return $first_tuesday->format('d/m/Y');
}
?>
You can read more about the DateTime class in the PHP manual (which is also available in French, as that seems to be your native language based on the original question.)