Hello, I am having a problem with week numbers..specifically a week like th is weeks. I count my weeks by using Monday-Sunday. A week like this week where the 30th is on a monday should be Week 1 (i think, right?) , since last week was week 52. Yet my script thinks this is week 52 still. how do i fix that?
function ISOWeek($y, $m, $d)
{
$week=strftime("%W", mktime(0, 0, 0, $m, $d, $y));
$dow0101=getdate(mktime(0, 0, 0, 1, 1, $y));
if ($dow0101["wday"]>1 && $dow0101["wday"]<5)
$week++;
elseif ($week==0)
$week=ISOWeek($y-1,12,31);
if ($week==53 && $m==12)
$week=ISOWeek($y+1,1,1);
return(substr("00" . $week, -2));
}
this too gives me 52nd week
echo "This Week is " . strftime("%U");