At 06:40 PM 3/18/2002 +0000, you wrote:
>Subject: How to add 2 years to todays date ?
>
>Hi All
>I think the subject line says it all.
>
>How to add 2 years to today's date ?
>
>Any helps as always most appreciated.
>
>
>
>Dave Carrera
>Php Developer
>
>
>Subject: Re: [PHP-DB] How to add 2 years to todays date ?
>
>In php
>$your_timestamp += gmmktime(0,0,0,1,1,1972);
>MySQL has INTERVALling options.
>
>Regards,
>Andrey
>
>Subject: RE: [PHP-DB] increase date()
>
>Try this:
>
>$six_months_from_now = date("Y-m-d", mktime(0,0,0, date(m)+6, date(1),
>date(Y)));
>echo "Six Months From Now: $six_months_from_now<P>";


In my coding, I've used:
         $date_var=date("Y-m-d",strtotime("+0 days"));

In your case, you could do it like:
         $date_var=date("Y-m-d", strtotime("+2 years"))
or
         $date_var=date("Y-m-d H:i", strtotime("+2 years"))
if you wanted hours/minutes

either example formats in a way that MySQL wants to see a date or datetime 
field (respectively)

hope it helps,

~ Rob Small
c0demonkey
Fresno, CA


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to