mysql/php date functions..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux