http://www.mysql.com/doc/en/Date_and_time_functions.html
Here is an example that uses date functions. The following query selects all records with a date_col value from within the last 30 days:
mysql> SELECT something FROM tbl_name
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
Pete
Jason wrote:
My logging application is feeding a MySQL database with data records that are time stamped with GMT time. I would like to query the database for records matching local time(eg. all records created on oct 17,2002 local time). I would prefer if the records could be formated in local time when returned from MySQL. What is the best way to do this.Jason
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php