RE: [PHP] strange behaviour with strtotime()
| From: | Ford, Mike | Date: | Tue, 31 Jan 2006 14:33:06 +0000 |
| Subject: | RE: [PHP] strange behaviour with strtotime() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-229553@lists.php.net to get a copy of this message | ||
On 31 January 2006 14:12, Barry wrote:
> Barry wrote:
> Last try:
> Edit:
> > > also 31st January -> +2 Month -> is for me 3rd April > >
> > > 31st March is not true because i miss "3" (!!) days. >
Huh? Are you saying that, for you:
strtotime("+2 months");
gives 3rd April? If so, I would be absolutely amazed, because I get 31st March, which is exactly
what I expect.
Of course, if you add 1 month to 31st Jan, then add 1 month to the result, you will get 3rd April --
but that's not the same as simply adding 2 months to 31st Jan. If you want 2 months from
today, ask for 2 months from today -- not 1 month from 1 month from today!!
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm