You are here: Re: This Monday problem « All PHP « IT news, forums, messages
Re: This Monday problem

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация