aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
index 6102b9b1900..e4308332dc1 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
@@ -475,7 +475,7 @@ public class IssueIndex extends BaseIndex {
bucketSize = DateHistogram.Interval.MONTH;
}
- int offsetInSeconds = system.getDefaultTimeZone().getRawOffset() / 1_000;
+ int offsetInSeconds = -system.getDefaultTimeZone().getRawOffset() / 1_000;
AggregationBuilder dateHistogram = AggregationBuilders.dateHistogram(CREATED_AT)
.field(IssueIndexDefinition.FIELD_ISSUE_FUNC_CREATED_AT)
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java
index f70375960f7..b684a2ec4a6 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java
@@ -84,7 +84,7 @@ public class IssueIndexTest {
issueAuthorizationIndexer = new IssueAuthorizationIndexer(null, tester.client());
viewIndexer = new ViewIndexer(null, tester.client());
System2 system = mock(System2.class);
- when(system.getDefaultTimeZone()).thenReturn(TimeZone.getTimeZone("GMT+1:00"));
+ when(system.getDefaultTimeZone()).thenReturn(TimeZone.getTimeZone("GMT-1:00"));
when(system.now()).thenReturn(System.currentTimeMillis());
index = new IssueIndex(tester.client(), system, userSessionRule);