Forum Moderators: coopster

Message Too Old, No Replies

Add days to <?php echo date('Y-m-d');?>

<?php echo date('Y-m-d');?>

         

stevesko

2:41 pm on Aug 3, 2006 (gmt 0)

10+ Year Member



Hi,

I'm using the following code in a hidden value in dreamweaver:

<?php echo date('Y-m-d');?> and want to add 90 days to the value before inserting into mysql db.. What should I add to the code to do this?

Basically, I'm giving a 90 free trial and want to set the renewal date to 90 days from today in the db.

Thanks,

Steve

dreamcatcher

2:48 pm on Aug 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello Steve,

The strtotime [uk2.php.net] function should be ideal for what you are looking for:

<?php echo date('Y-m-d', strtotime("+90 days"));?>

dc

stevesko

2:55 pm on Aug 3, 2006 (gmt 0)

10+ Year Member



dc,

I can't tell you how much time I wasted trying to figure this out...

Thanks so much... Now when my wife asks me why I "waste" so much time helping others out on forums I'll have a good answer!

THANKS AGAIN!

Steve