In my table I have a varchar column called date
containing string representations of dates in dd/mm/yyyy format. How can I convert these to Unix times in a SELECT query?
select unix_timestamp(str_to_date('30/05/2011','%d/%m/%Y'));
or:
select unix_timestamp(str_to_date(myfield,'%d/%m/%Y')) from mytable;
I think UNIX_TIMESTAMP should do the trick. Can you specify your select query here?
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_unix-timestamp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With