|
Posted by info on 09/27/05 01:06
Hello Bruce,
While the date functions are well documented - http://php.net/date - here is a little example to manipulate the date with php, rather than mysql:
// set the new expiry date
// DATE FUNCTIONS FOR THE EXPIRY MODULE
// first perform date arithmetic
$listingExpiry = mktime (0,0,0,date("m")+$monthsGoodFor,date("d")+1,date("Y"));
// secondly, format the results for use in the database
$expires = date ("Y-m-d", $listingExpiry);
// the actual update of the database with expires='$expires' ... should be below here
The date format to be used in $expires depends on your database column structure.
Rob.
http://www.globalissa.com
[Back to original message]
|