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));
This
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 = $currentyear + 1;
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,
3 matches
Mail list logo