[TriLUG] Perplexed

Brian Henning brian at strutmasters.com
Tue Apr 4 12:25:53 EDT 2006


Matt Frye 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.  

Um, yes?  Today is Tuesday.  "Last Monday" was yesterday.  I guess it's 
a difference in interpretation of "last."  We often use "last" to mean 
"the day by that name which was a part of 'last week'."  PHP understands 
it to mean "the last day by that name which occurred."

Cheers,
~Brian





More information about the TriLUG mailing list