Jarrod
Jarrod

Reputation: 949

MySQL - How to Cast a datetime from an rss feed

I'm importing an rss feed into MySQL 5.1 via wget and LOAD DATA INFILE.

This is all working well, but, I'm having problems converting the date & time in the rss feed to a datetime col in mysql.

An example date from the feed is:

Sat, 19 Jan 2013 11:10:19 GMT

Any ideas how I can cast or convert this?

Thanks

J.

Upvotes: 1

Views: 95

Answers (2)

John Woo
John Woo

Reputation: 263723

use STR_TO_DATE

SELECT STR_TO_DATE(DATE_STRING,'%a, %d %b %Y %h:%i:%s')

OTHER SOURCE

Upvotes: 1

bonCodigo
bonCodigo

Reputation: 14361

How about this? using str_to_Date:

STR_TO_DATE('rss_date', '%y-%m-%d')

Upvotes: 2

Related Questions