RE: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Ford, Mike
On 31 January 2006 15:41, Barry wrote: > Ford, Mike wrote: > > Yes, but 1 apple is 1 apple is 1 apple. > > > > 1 month can be 28 days, or 31 days, or anything in between. > 2 months can be anything from 59 to 62 days. > > > > A month is an imprecise measure, and adding them together > will get y

Re: [PHP] strange behaviour with strtotime()

2006-01-31 Thread James Benson
cheers for the help :) Barry wrote: > Ford, Mike wrote: >> Yes, but 1 apple is 1 apple is 1 apple. >> >> 1 month can be 28 days, or 31 days, or anything in between. 2 months >> can be anything from 59 to 62 days. >> >> A month is an imprecise measure, and adding them together will get you >>

Re: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Barry
Ford, Mike wrote: Yes, but 1 apple is 1 apple is 1 apple. 1 month can be 28 days, or 31 days, or anything in between. 2 months can be anything from 59 to 62 days. A month is an imprecise measure, and adding them together will get you an even more imprecise result. Deal with it -- that's just

RE: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Ford, Mike
On 31 January 2006 14:52, Barry wrote: > Ford, Mike wrote: > > 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. > >

Re: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Barry
Ford, Mike wrote: 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

RE: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Ford, Mike
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

RE: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Ford, Mike
On 31 January 2006 13:04, James Benson wrote: > "Because 1 month from 31-Jan is 31-Feb -- which is taken to > mean 02-Mar, > hence the output of date("M" ...)." > > > > why though, one month from now is 31 Feb, why would it take it as > something else? > > That does not make sense to me! Wel

RE: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Ford, Mike
On 31 January 2006 13:50, James Benson wrote: > Barry wrote: > > Ford, Mike wrote: > > > > > > > > Because 1 month from 31-Jan is 31-Feb -- which is taken to mean > > > 02-Mar, hence the output of date("M" ...). > > > > > > 2 months from now is 31-Mar, which is ok; 3 months from now would > > >

Re: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Barry
Barry wrote: Barry wrote: Ford, Mike wrote: Uhm -- my mistake, sorry -- 31st Feb equates to 3rd March, not 2nd, so 3rd April here is correct. The basic thing is that strtotime() just uses the same day-of-the-month when calculating in months -- so, on the 31st January, it reckons thus:

Re: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Barry
Barry wrote: Ford, Mike wrote: Uhm -- my mistake, sorry -- 31st Feb equates to 3rd March, not 2nd, so 3rd April here is correct. The basic thing is that strtotime() just uses the same day-of-the-month when calculating in months -- so, on the 31st January, it reckons thus: +1 month: 31s

Re: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Barry
Ford, Mike wrote: Uhm -- my mistake, sorry -- 31st Feb equates to 3rd March, not 2nd, so 3rd April here is correct. The basic thing is that strtotime() just uses the same day-of-the-month when calculating in months -- so, on the 31st January, it reckons thus: +1 month: 31st February -- *doe

RE: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Ford, Mike
On 31 January 2006 13:13, Barry Krein wrote: > Ford, Mike wrote: > > > > > Because 1 month from 31-Jan is 31-Feb -- which is taken to > mean 02-Mar, hence the output of date("M" ...). > > > > 2 months from now is 31-Mar, which is ok; 3 months from now > would be 31-Apr, which would likewise be

Re: [PHP] strange behaviour with strtotime()

2006-01-31 Thread James Benson
Barry wrote: > Ford, Mike wrote: > >> >> Because 1 month from 31-Jan is 31-Feb -- which is taken to mean >> 02-Mar, hence the output of date("M" ...). >> >> 2 months from now is 31-Mar, which is ok; 3 months from now would be >> 31-Apr, which would likewise be taken to mean 01-May. >> >> This is

Re: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Barry
Ford, Mike wrote: Because 1 month from 31-Jan is 31-Feb -- which is taken to mean 02-Mar, hence the output of date("M" ...). 2 months from now is 31-Mar, which is ok; 3 months from now would be 31-Apr, which would likewise be taken to mean 01-May. This is all as expected -- no bug here. Ch

Re: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Barry Krein
Ford, Mike wrote: Because 1 month from 31-Jan is 31-Feb -- which is taken to mean 02-Mar, hence the output of date("M" ...). 2 months from now is 31-Mar, which is ok; 3 months from now would be 31-Apr, which would likewise be taken to mean 01-May. This is all as expected -- no bug here. Ch

Re: [PHP] strange behaviour with strtotime()

2006-01-31 Thread James Benson
"Because 1 month from 31-Jan is 31-Feb -- which is taken to mean 02-Mar, hence the output of date("M" ...)." why though, one month from now is 31 Feb, why would it take it as something else? That does not make sense to me! James -

RE: [PHP] strange behaviour with strtotime()

2006-01-31 Thread Ford, Mike
On 31 January 2006 11:24, James Benson wrote: > Im encountering some very weird behaviour when using the following:- > > > echo date("M", strtotime("next month")); > > > outputs: Mar > > > > while > > > echo date("r",time()); > > outputs: Tue, 31 Jan 2006 11:21:47 + > > > > anyone

[PHP] strange behaviour with strtotime()

2006-01-31 Thread James Benson
Im encountering some very weird behaviour when using the following:- echo date("M", strtotime("next month")); outputs: Mar while echo date("r",time()); outputs: Tue, 31 Jan 2006 11:21:47 + anyone know why? - Master CIW D