[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-636) DateBridge substracts one day from date
Marc Schipperheyn (JIRA)
noreply at atlassian.com
Fri Nov 19 07:13:14 EST 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39171#action_39171 ]
Marc Schipperheyn commented on HSEARCH-636:
-------------------------------------------
Not sure about the hour thing. It would certainly have an impact on other parts of the code as well, and may also impact Lucene performance.
As far as documentation goes
When you use Hibernate Search %component%, it normalizes dates to GMT. This means that if your dates are formatted for another timezone, you may run into issues such as:
* A date that is stored at 'Day'-resolution, e.g. 2010-11-28 00:00 GMT+1 will be stored as 20101127 because in GMT time it is: 2010-11-27 23:00 GMT
* A date that is stored as e.g. 2010-11-27 23:00 GMT-6 will be stored as 20101128 because in GMT time it is: 2010-11-28 05:00 GMT
As the timezone difference to GMT becomes bigger, the unwanted side effects may also increase. Solutions to this include:
* Storing all your dates in GMT
* Writing your own date to string bridge
> DateBridge substracts one day from date
> ---------------------------------------
>
> Key: HSEARCH-636
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-636
> Project: Hibernate Search
> Issue Type: Bug
> Affects Versions: 3.3.0.CR1
> Environment: Lucene 3.0.2
> Reporter: Marc Schipperheyn
>
> I find that the public String objectToString(Object object) in the DateBridge class consistently returns a date that's one day before the date being passed.
> A Date object with date 2011-12-12 will become a string representation of 2011-12-11.
> Since the Lucene core DateTools are used, I assume the problem lies there and you might want to consider moving to another date library.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list