Posted by petersprc on 11/20/06 04:28
You could do something like this:
<?
function firstDayOfMonth($str = '2006-11-19')
{
$day = date('l', strtotime(date('Y/m/01', strtotime($str))));
return $day;
}
echo firstDayOfMonth();
?>
Change the date format string if you want other information about the
first day of the month.
meltedown wrote:
> If I have an sql date, such as "2006-11-19" is there a way using either
> sql or php date and time functions to get the date of the the first day
> of the month ?
Navigation:
[Reply to this message]
|