summaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-06-20 15:08:26 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-06-20 15:08:39 +0200
commit87f1cd0960598af76b04faefe6a8c7fc5b54c874 (patch)
treec5cbcb2a2756883d742116d2d80c34dc3d95746e /sonar-server/src/main
parentb32fa65e763b16e9dd00d31c8c0ce46a00286cc3 (diff)
downloadsonarqube-87f1cd0960598af76b04faefe6a8c7fc5b54c874.tar.gz
sonarqube-87f1cd0960598af76b04faefe6a8c7fc5b54c874.zip
SONAR-5329 - Convert ES time to current timeZones
Diffstat (limited to 'sonar-server/src/main')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/search/IndexUtils.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/search/IndexUtils.java b/sonar-server/src/main/java/org/sonar/server/search/IndexUtils.java
index 02d69bb96ce..bba38b2afe1 100644
--- a/sonar-server/src/main/java/org/sonar/server/search/IndexUtils.java
+++ b/sonar-server/src/main/java/org/sonar/server/search/IndexUtils.java
@@ -25,6 +25,7 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.TimeZone;
public class IndexUtils {
@@ -38,8 +39,12 @@ public class IndexUtils {
return null;
}
try {
+
+ // ES times are in UTC
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+ sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
return sdf.parse(s);
+
} catch (ParseException e) {
throw new IllegalArgumentException("Cannot parse ES date: " + s, e);
}