| Subcribe via RSS


FROM_UNIXTIME - to convert timestamp to string date in mysql

February 10th, 2008 | No Comments | Posted in mysql by dreamluverz


I’ve been looking for a solution on how to convert timestamp to string in my query. I’ve tried using DATE_FORMAT but it didn’t work coz my dates are saved as timestamp. After long search I found this… FROM_UNIXTIME… and it solved my problem :)

select FROM_UNIXTIME(1202635768, ‘%Y%m’)  from table

=> will return 200802

Tags: , ,