Exactly right Warren,
This is what you're looking for:

echo date("Y-m-d",strtotime("last Monday -1 week")). "\n";

Brian


Warren Myers wrote:
Well, 2006-04-03 is last Monday from today.

WMM

On 4/4/06, Matt Frye <[EMAIL PROTECTED]> wrote:
On 4/4/06, Brian Henning <[EMAIL PROTECTED]> wrote:
...why aren't you using PHP's built-in date/time functions?
Ok.

But...

echo date("Y-m-d",strtotime("last Monday")), "\n";

yet gives me 2006-04-03 instead of 2006-03-27.  I still have to resort
to a loop to get the right numbers of days back...which is ok because
date() and strtotime do it correctly.

<?php
$day = date("l") ;
print "<br>Day is $day - Before<br>";
switch ($day) {
case "Monday":
   print "<br>Day is $day - During<br>";
   $startdated = date("Y-m-d",strtotime("a week ago")) ;
   break;

and so on.  I still don't understand why the other loop didn't work.
I guess it doesn't matter.  Thanks Brian.

MPF
--
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ  : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/




--
http://warrenmyers.com
"God may not play dice with the universe, but something strange is going on
with the prime numbers." --Paul Erdo"s
"It's not possible. We are the type of people who have everything in our
favor going against us." --Ben Jarhvi, Short Circuit 2
------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.3.5/300 - Release Date: 4/3/2006

--
Brian Bell
Kneecap Interactive
919-321-1365
[EMAIL PROTECTED]

--
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ  : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/

Reply via email to