tags:

views:

140

answers:

2

Let me know :)

$add_date = date ("Y-m-d H:m:s"); 
$expiry_date = 'how?';

How to insert into db the $expiry_date for 60 days. mysql format is datetime

+10  A: 

Use strtotime():

$start_date = date('Y-m-d H:m:s');
$end_date = date('Y-m-d H:m:s', strtotime("+60 days"));

or more simply:

$end_date = date('Y-m-d H:m:s', time() + 86400 * 60);
cletus
thanks mate.. I was try to get it done over 2 hours.
bob
+1  A: 

A method avoiding time conversions:

$time = date('Y-m-d H:m:s', time()+3600*24*60)

EDIT
However, it may be less readable and the time saved is probably irrelevant. Plus cletus just edited a similar method into his answer

Yacoby