FROM_UNIXTIME without time zone conversion?

1

What's the best approach to convert 0x00000009 to 1970-01-01-00:00:09?

I've tried FROM_UNIXTIME but it returns 1969-12-31 22:00:09.

From http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_unix-timestamp, I understand there is a time zone conversion going on.

mysql
asked on Stack Overflow Oct 1, 2014 by vrltwe

1 Answer

2

When time zones are a problem, try the CONVERT_TZ() function:

SELECT CONVERT_TZ(FROM_UNIXTIME(9), 'SYSTEM', '+0:00')
answered on Stack Overflow Oct 1, 2014 by miken32 • edited Mar 3, 2020 by miken32

User contributions licensed under CC BY-SA 3.0