in reply to Converting from Date Time to Unix Time
That will return a unix time value that assumes that the database server runs in the GMT (or UTC) timezone, which it probably doesn't.select datediff(ss, 'jan 1 1970', datetime_column) from ...
You can convert the $time value from this expression to the real Unix time value for your timezone with:
OK - so it's not the simplest way to do this - however it's good to be aware of what you can do at the database level. :-)use Time::Local; $time = timelocal(gmtime($time_from_database));
Michael
|
|---|