[Tfug] PHP calculating date from week

Ammon Lauritzen ammon at simud.org
Tue Jun 20 15:02:26 MST 2006


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




More information about the tfug mailing list