Skip to content

Commit

Permalink
Update IntervalHelper to use UTC time instead of local timezone time
Browse files Browse the repository at this point in the history
  • Loading branch information
Daan Kooij committed Jul 16, 2018
1 parent 023d9e7 commit 1708880
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/nl/utwente/ing/misc/date/IntervalHelper.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package nl.utwente.ing.misc.date;

import java.time.LocalDateTime;
import java.time.ZoneOffset;

/**
* The IntervalHelper class.
Expand All @@ -27,7 +28,7 @@ public class IntervalHelper {
*/
public static LocalDateTime[] getIntervals(IntervalPeriod intervalPeriod, int amount) {
LocalDateTime[] intervals = new LocalDateTime[amount + 1];
intervals[amount] = LocalDateTime.now();
intervals[amount] = LocalDateTime.now(ZoneOffset.UTC);

if (intervalPeriod == IntervalPeriod.YEAR) {
for (int i = amount - 1; i >= 0; i--) {
Expand Down

0 comments on commit 1708880

Please sign in to comment.