note 15248 added to function.date

From: Date: Mon, 03 Sep 2001 10:30:55 +0000
Subject: note 15248 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-17558@lists.php.net to get a copy of this message
I wanted to get the week of the year (0-52) I thought you could do that with date but apparently not. This is what I came up with to get it... $first = strtotime('1/1/'.intval(date('Y'))); $secondsinaweek=60*60*24*7; $weekofyear = intval( (time()-$first) / $secondsinaweek ) ); Not sure exactly what the bounds returned from this are but I only needed a rough week for my app. http://uk.php.net/manual/en/function.date.php

« previous php.notes (#17558) next »