You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by gateway0 <re...@yahoo.de> on 2009/04/09 14:48:31 UTC

Dataimporthandler + MySQL = Datetime offset by 2 hours ?

Hi,

im fetching entries from my mysql database and index them with the
Dataimporthandler:

MySQL Table entry: (for example)
pr_timedate : 2009-04-14 11:00:00 

entry in data-config.xml to index the mysql field:
<field column="pr_timedate" name="completion"
dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss'Z'" />

result in solr index:
<date>2009-04-14T09:00:00Z</date>:confused:

it says 09:00:00 instead of 11:00:00 as it supposed to. 

I´ve searched for hours already, why is that?

best wishes, Sebastian
-- 
View this message in context: http://www.nabble.com/Dataimporthandler-%2B-MySQL-%3D-Datetime-offset-by-2-hours---tp22970250p22970250.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Dataimporthandler + MySQL = Datetime offset by 2 hours ?

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Thu, Apr 9, 2009 at 6:18 PM, gateway0 <re...@yahoo.de> wrote:

>
> Hi,
>
> im fetching entries from my mysql database and index them with the
> Dataimporthandler:
>
> MySQL Table entry: (for example)
> pr_timedate : 2009-04-14 11:00:00
>
> entry in data-config.xml to index the mysql field:
> <field column="pr_timedate" name="completion"
> dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss'Z'" />
>
> result in solr index:
> <date>2009-04-14T09:00:00Z</date>:confused:
>
> it says 09:00:00 instead of 11:00:00 as it supposed to.
>
> I´ve searched for hours already, why is that?
>

I think that may be because date/time in Solr is supposed to be in UTC. See
the note on DateField in the schema.xml
-- 
Regards,
Shalin Shekhar Mangar.