vrltwe
vrltwe

Reputation: 53

FROM_UNIXTIME without time zone conversion?

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.

Upvotes: 1

Views: 2948

Answers (1)

miken32
miken32

Reputation: 42736

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

SELECT CONVERT_TZ(FROM_UNIXTIME(9), 'SYSTEM', '+0:00')

Upvotes: 2

Related Questions