Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

casting in MySQL

Tags:

sql

casting

mysql

I have a varchar field that looks like (sadly I have no control over the data):

Fri, 30 Oct 2009 06:30:00 EDT

Is there a way to cast this into a timestamp format so that I can then sort based on it?

like image 411
Petrogad Avatar asked Nov 25 '25 01:11

Petrogad


1 Answers

SELECT  STR_TO_DATE('Fri, 30 Oct 2009 06:30:00 EDT', '%a, %d %b %Y %H:%i:%s EDT')
like image 190
Quassnoi Avatar answered Nov 27 '25 13:11

Quassnoi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!