I’m parsing a feed that contains a “created at” entry, formatted like this:
Thu, 08 Oct 2009 23:01:33 +0000
I need to be able to store this in a MySQL table, in a DateTime datatype. Then, I want to select rows WHERE datetime clause equals or in range between dates and/or times.
I have two questions:
- Will this string be acceptable as a MySQL DateTime datatype?
- If yes, which query should I construct to get results from and between dates or hours?
You could do something along these lines (in your language of choice) to turn your string into an acceptable mysql datetime:
There are a few ways to find records between two dates, this is my favourite: