Re: MySQL GMT --> Local time

From: Date: Wed, 06 Nov 2002 10:55:32 +0000
Subject: Re: MySQL GMT --> Local time
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-122961@lists.php.net to get a copy of this message
This might help 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


« previous php.general (#122961) next »