Search code examples
mysqldatetimeepoch

Convert double to mysql date format


In mysql, I had one table students and that table contains one column name as runtime and that contains values like 1381387683741, 1381387683739 etc.

when I convert this using covertor it shows results

Thu, 10 Oct 2013 06:48:03 GMT

So my question is how I can convert this same as using mysql query ?


Solution

  • Try this:

    select from_unixtime(substring(runtime,1,10)) from students;