Skip to content

Commit

Permalink
HSEARCH-1938 StringEncodingCalendarBridge using the wrong TimeZone
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Jul 29, 2015
1 parent 76bcbf8 commit be8de4a
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -8,6 +8,8 @@

import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

import org.apache.lucene.document.Document;

Expand Down Expand Up @@ -42,6 +44,8 @@ public class StringEncodingCalendarBridge extends StringEncodingDateBridge {
Resolution.MILLISECOND
);

private static final TimeZone ENCODING_TIME_ZONE = TimeZone.getTimeZone( "UTC" );

public StringEncodingCalendarBridge() {
}

Expand All @@ -53,7 +57,7 @@ public StringEncodingCalendarBridge(Resolution resolution) {
public Object get(String name, Document document) {
Object value = super.get( name, document );
if ( value != null ) {
Calendar calendar = Calendar.getInstance();
Calendar calendar = Calendar.getInstance( ENCODING_TIME_ZONE, Locale.ROOT );
calendar.setTime( (Date) value );
value = calendar;
}
Expand Down

0 comments on commit be8de4a

Please sign in to comment.