I'm trying to get the 1st and last day of the current week. I ty to do this: $startofweek = date("Y-m-d",mktime (0,0,0,date("m") ,date("d")-date("w"),date("Y"))); $endofweek = date("Y-m-d",mktime (0,0,0,date("m") ,date("d",strtotime($startofweek))+6,date("Y"))); echo $startofweek." --- ".$endofweek;
$startofweek is correct, but if you run it for a week that has it's beginning date in an other month (like this week), the $endofweek is in the wrong month. What gives? If I change -date("w") to -1 or anything else that stays within the current month, it works. What do you think? Is there a better way to do this? - Anthony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php