From ff62d4efa097804bb828a55fe96b8943197d4cd9 Mon Sep 17 00:00:00 2001 From: Rob Rua Date: Fri, 18 Jul 2014 16:09:54 -0400 Subject: [PATCH] Change timestamps to UTC timezone (per Riot fix) --- src/lib/orianna/api/JSONConverter.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/lib/orianna/api/JSONConverter.java b/src/lib/orianna/api/JSONConverter.java index f445a9e8d..d4018534d 100644 --- a/src/lib/orianna/api/JSONConverter.java +++ b/src/lib/orianna/api/JSONConverter.java @@ -1,9 +1,7 @@ package lib.orianna.api; import java.time.LocalDateTime; -import java.time.ZoneId; import java.time.ZoneOffset; -import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -74,9 +72,6 @@ * @author Rob Rua (FatalElement - NA) (robrua@alumni.cmu.edu) */ public class JSONConverter { - // It scares me that this is the best way to get a local offset right now... - private static final ZoneOffset timeZone = ZoneOffset.from(ZonedDateTime.now(ZoneId.systemDefault())); - private static Integer convertInteger(final Object object) { final Long longVersion = (Long)object; if(longVersion == null) { @@ -90,7 +85,7 @@ private static LocalDateTime getDateTime(final JSONObject object, final String k if(epoch == null) { return null; } - return LocalDateTime.ofEpochSecond(epoch / 1000, 0, timeZone); + return LocalDateTime.ofEpochSecond(epoch / 1000, 0, ZoneOffset.UTC); } private static List getDoubleList(final JSONArray list) {