|
Posted by J.O. Aho on 03/22/07 13:47
Adam wrote:
> Hi folks,
>
> I need to be able to return the corresponding dates for Mondays - and
> have tried various functions, scripts with varying degrees of success.
> date('d-M-Y', strtotime('this monday'));
>
> ... works, as does:
>
> date('d-M-Y', strtotime('last monday'));
>
> However, whilst this function works well most of the time, for some
> reason it pukes on Monday 19th March - and always returns 18th Mar
> (which is a Sunday!).
Sure you haven't set the year to 2002 or 2013?
Does "date('d-M-Y', strtotime('last monday')+1);" make any difference?
> I could understand it if it crossed a leap year threshold of some sort
> (eg. Feb 28th) - but 18 March???
> This is with both PHP4 and PHP5.
What system does the php run on?
--
//Aho
[Back to original message]
|