I have a mysql database with a column for dates with unix time format. How can I write a mysql_query to find "March 8, 2011"?
Column: start_date Row 1: 1299604410
Why not store the date in a DATE/DATETIME column so that it's more meaningful/useful?
I have multiple columns that has different types of dates (start,end,etc).
All of those could of course be stored as datetime.
But, assuming you know how to turn your date format into SQL (and ISO) standard format, unix_timestamp
I was a little hesitant with changing the column type because I would need to rewrite the script to not use unixtime. DATE looks like the way to go. Thanks guys.
There are ways in MySQL to work with Unix timestamps (check out FROM_UNIXTIME()), however note that starting out with a 'DATE' format in the first place would simplify your queries when working with the data.