Reply to Re: Last Day of Year Date Bug?

Your name:

Reply:


Posted by Jerry Stuckle on 12/31/07 14:27

Rik Wasmus wrote:
> On Mon, 31 Dec 2007 14:18:34 +0100, Jerry Stuckle
> <jstucklex@attglobal.net> wrote:
>
>> ashore wrote:
>>> Guys, the line below just returned "Dec 07" as the date for one month
>>> back from today. Hardly life-threatening, but any thoughts?
>>> <?php print date("M `y", mktime(0, 0, 0, date("m")-1, date("d"),
>>> date("Y")));?>
>>> AS
>>>
>>
>> Interesting. Looks like it may be a bug.
>>
>
> Nope,
> date('m')-1 = 11
> date('d') = 31
>
> 31-11-2007 = 01-12-2007 as far as php is concerned.
>
> Not 'end of a year' bug, but '31st of every month' bug (well, feature
> I'd say, I know what to expect), with a few bonus dates in march.

Ah, yes. Now I remember why I don't do it this way - it's been so long
I forgot.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original 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

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