mysql/php date functions..

From: Date: Mon, 26 Sep 2005 22:06:06 +0000
Subject: mysql/php date functions..
Groups: php.general 
Request: Send a blank email to php-general+get-223238@lists.php.net to get a copy of this message
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

« previous php.general (#223238) next »