On Mar 19, 2013, at 12:04 PM, Spadez <james_will...@hotmail.com> wrote:

> This is the datetime format SOLR requires as I understand it:
> 
> 1995-12-31T23:59:59Z
> 
> When I try to store this as a datetime field in MySQL it says it isn't
> valid. My question is, ideally I would want to keep a datetime in my
> database so I can sort by date rather than just making it a varchar, so I
> would store it like this:
> 
> 1995-12-31 23:59:59 
> 
> Can import date in this format into SOLR from MySQL?

Yes.  Don't change the storage type of your column in MySQL.  Changing to 
VARCHAR would be sad.

What you'll need to do is use a date formatting function in your SELECT out of 
the MySQL database to get the date into the format that MySQL likes.

See 
https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format
 

xoa


--
Andy Lester => a...@petdance.com => www.petdance.com => AIM:petdance

Reply via email to