Re: Last Day of Year Date Bug?



On Mon, 31 Dec 2007 14:18:34 +0100, Jerry Stuckle <jstucklex@xxxxxxxxxxxxx> 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.
--
Rik Wasmus
.



Relevant Pages

  • Re: BUG or FEATURE
    ... needs to prove that "See this seems to be a bug to me - I am typical ... and no where it is mentioned that the feature should work like this". ... lack of knowledge that "there is no Oracle". ... which ones (does management think) are the most ...
    (comp.software.testing)
  • Re: BUG or FEATURE
    ... 10x two all for replay. ... work better/easier will be a feature and not bug. ... goes to oracle. ...
    (comp.software.testing)
  • Looking for the antonym for enhancement - A SolidWords study.
    ... because the word enhancement carries with it ... Marketroid-speak for a bug fix. ... Common marketroid-speak for a bug fix. ... A hacker being ironic would instead call the fix a feature -- ...
    (comp.cad.solidworks)
  • Re: Looking for the antonym for enhancement - A SolidWords study.
    ... from dictionaries and thesauri in an effort to augment our ... because the word enhancement carries with it ... Marketroid-speak for a bug fix. ... A hacker being ironic would instead call the fix a feature -- ...
    (comp.cad.solidworks)
  • Re: Looking for the antonym for enhancement - A SolidWords study.
    ... from dictionaries and thesauri in an effort to augment our ... because the word enhancement carries with it ... Marketroid-speak for a bug fix. ... A hacker being ironic would instead call the fix a feature -- ...
    (comp.cad.solidworks)