[TriLUG] Perplexed

Warren Myers volcimaster at gmail.com
Tue Apr 4 12:11:56 EDT 2006


Well, 2006-04-03 is last Monday from today.

WMM

On 4/4/06, Matt Frye <mattfrye at gmail.com> wrote:
>
> On 4/4/06, Brian Henning <brian at strutmasters.com> 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 Erdő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


More information about the TriLUG mailing list