Image

Imagenotrub225 wrote in Imagewebdev

using SQL DATETIME format with PHP date() function

How do I convert the SQL DATETIME format so that it can be used with the PHP date() function?

I tried

SELECT UNIX_TIMESTAMP(date) from 'events'

which should work but the time is always 4 hours off.


For example, if the value is '2008-06-28 23:00:00', SELECT UNIX_TIMESTAMP(date) produces 1214694000 which translates to June 28th, 2008 -- 7:00pm