7

I have a table with the column create_time which is of type INTEGER and represents the time since epoch.

I'd like to select all rows and columns, while displaying this row as a date/time in UTC format.

How do I do that?

1 Answer 1

9

Use FROM_UNIXTIME to convert seconds since epoch to a DATETIME, which also allows you specify a format:

FROM_UNIXTIME(create_time, '%Y-%m-%d %H:%i:%s')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.