Page 1 of 1

[SOLVED] monday of the week ???

Posted: Mon Jan 09, 2006 1:08 pm
by wtf
Hi,

date('W') returns current week of the month based on Monday. What I need to know is what date is that Monday?

exp:

week 2 - Monday 01/09/2005


Regards...

Posted: Mon Jan 09, 2006 1:40 pm
by timvw

Code: Select all

<?php
echo date("Y-m-d", strtotime("monday"));
?>

Posted: Mon Jan 09, 2006 1:50 pm
by wtf
sweet.... didn't expect it to be that easy. Some complex stuff listed on php.net

or

check this one out...


http://www.phpbuilder.com/board/showthr ... t=10222903

thanks

Posted: Mon Jan 09, 2006 1:54 pm
by timvw
Don't underestimate the power of http://www.php.net/strtotime. There are a couple of impressive possibilities mentionned in the comments too..