[SOLVED] monday of the week ???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
wtf
Forum Contributor
Posts: 331
Joined: Thu Nov 03, 2005 5:27 pm

[SOLVED] monday of the week ???

Post 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...
Last edited by wtf on Thu Jan 12, 2006 8:55 pm, edited 3 times in total.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Code: Select all

<?php
echo date("Y-m-d", strtotime("monday"));
?>
User avatar
wtf
Forum Contributor
Posts: 331
Joined: Thu Nov 03, 2005 5:27 pm

Post 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
Last edited by wtf on Mon Jan 09, 2006 2:00 pm, edited 1 time in total.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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..
Post Reply