Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql Unix-Timestamp Date Format

In mysql database I store date column as unix-timestamp format (for example:1264105904). I want to convert this date to datetime like "Oct 11, 2011 6:25 am PDT" in select statement. How can I achieve this?

like image 778
Umut Derbentoğlu Avatar asked Nov 22 '11 08:11

Umut Derbentoğlu


1 Answers

select date_format(from_unixtime(1264105904),'%b %d, %Y %l:%i %p PDT');

should do what you want

like image 62
Gryphius Avatar answered Sep 19 '22 09:09

Gryphius