Adrian wrote: > if(date("w",$weekstamp) == 0){ > $datestamp = $weekstamp; > }else{ > $datestamp = strtotime("last Sunday",$weekstamp); > } Yup. I'm definitely not awake. The final line of code that I didn't give you in my previous email looks something like this: $datestamp = $weekstamp - $day_of_week; Ammon