[SOLVED] getting weeknumber from date
Posted: Thu Nov 02, 2006 1:26 am
o/
the problem is this i want to build a script that takes the time out of the database
and converts it to a different value.
now this would normally not be a problem but i want the weeknumber
(say week 1 to 52)
the problem here is that the only dates i have are like this: 01-08-2006 (the date is from a database)
i need a week number for this what i have is the following:
the resullt for this is:
01
3-8-2006
W stands for the weeknumber
and the strtotime is supposed to disect the date
what am i doing wrong and can i get a pointer in the right direction
the problem is this i want to build a script that takes the time out of the database
and converts it to a different value.
now this would normally not be a problem but i want the weeknumber
(say week 1 to 52)
the problem here is that the only dates i have are like this: 01-08-2006 (the date is from a database)
i need a week number for this what i have is the following:
Code: Select all
$weeknr = date("W", strtotime($s_date));
echo "$weeknr<br>";
echo $s_datum;01
3-8-2006
W stands for the weeknumber
and the strtotime is supposed to disect the date
what am i doing wrong and can i get a pointer in the right direction