0Day Forums
Solr - Import date time field from DB -> 2 hours difference - Printable Version

+- 0Day Forums (https://0day.red)
+-- Forum: Coding (https://0day.red/Forum-Coding)
+--- Forum: Database (https://0day.red/Forum-Database)
+---- Forum: Solr (https://0day.red/Forum-Solr)
+---- Thread: Solr - Import date time field from DB -> 2 hours difference (/Thread-Solr-Import-date-time-field-from-DB-gt-2-hours-difference)



Solr - Import date time field from DB -> 2 hours difference - cortneyydal - 07-30-2023

I'm importing a datetime column (SQLServer) in Solr, and the values is always 2 hours early in solr that in the DB, with full and delta imports.

I have configured jvm with the correct time (in the logs it's show the correct time).

I think I have to configure something in data-config.xml but I can't find any information.

Thanks in advance.


RE: Solr - Import date time field from DB -> 2 hours difference - sherylsheryle379 - 07-30-2023

You need to convert your date/times into UTC format when you use the data import handler. See [this thread][1] on how to do it. AFAIK Solr always expects your dates in UTC format, no matter what the timestamp of the JVM is. Ditto for when you retrieve and display the date (it will be UTC).


[1]:

[To see links please register here]