Reply to [PHP] mysql/php date functions..

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация