I am having a problem in mysql query, I have date saved in database in this format :
Wed, 26 Oct 2011 01:25:35 EDT
I want to sort the rows by date but this date format is not letting me do it. I have tried Date_FORMAT AND STR_TO_DATE function but couldn’t get it working, could you please help me solve this?
Assuming you’ve modified your tables so you’ve got the original date field (‘olddate’) and want to put the reformatted ‘native’ date into a new field (‘newdate’), then:
however, MySQL does not store timezone information in its date/time fields, so you’d have to convert the EDT stuff to whatever TZ is desired (UTC?).
Once converted to native format, you’d do your sorting with: