Re: [PHP] correct date (cont.)

2001-08-09 Thread Richard Lynch
> This should get me exactly 3 months later and also checks for if its a later No, it won't on leap years, or during daylight savings time changes, etc. Don't try to do the year/month calculation yourself. Let PHP do it for you, and it will be correct. Every time. $threemonths = mktim(0, 0, 0

Re: [PHP] correct date (cont.)

2001-08-09 Thread Renze Munnik
On Thu, Aug 09, 2001 at 01:08:33PM -0400, [EMAIL PROTECTED] wrote: > Oops..(Hit send prematurely.) > > $currentmonth = date("m"); > $currentday = date("d"); > $year = date("Y"); > $newmonth = $currentmonth + 3; > if ($newmonth > 12){ > $newmonth = $newmonth % 12; > $year = $curr

Re: [PHP] correct date

2001-08-09 Thread Renze Munnik
On Thu, Aug 09, 2001 at 01:05:14PM -0400, [EMAIL PROTECTED] wrote: > I am making a site where people get 3 free months from when they register. > In a table I have 2 different fields; 1 for when they register, and another I > want exactly 3 months later. I have this code: > I don't think tha

[PHP] correct date (cont.)

2001-08-09 Thread DrWebPat
Oops..(Hit send prematurely.) $currentmonth = date("m"); $currentday = date("d"); $year = date("Y"); $newmonth = $currentmonth + 3; if ($newmonth > 12){ $newmonth = $newmonth % 12; $year = $currentyear + 1; } $3months = date("Y-m-d",mktime(0,0,0,$newmonth,$currentday,$year))

[PHP] correct date

2001-08-09 Thread DrWebPat
I am making a site where people get 3 free months from when they register. In a table I have 2 different fields; 1 for when they register, and another I want exactly 3 months later. I have this code: