note 15248 deleted from function.date by jimw

From: Date: Fri, 02 Nov 2001 01:13:04 +0000
Subject: note 15248 deleted from function.date by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-20102@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.

« previous php.notes (#20102) next »