Skip to content

Commit

Permalink
Change timestamps to UTC timezone (per Riot fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Rua committed Jul 18, 2014
1 parent ad503a9 commit ff62d4e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/lib/orianna/api/JSONConverter.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -74,9 +72,6 @@
* @author Rob Rua (FatalElement - NA) ([email protected])
*/
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) {
Expand All @@ -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<Double> getDoubleList(final JSONArray list) {
Expand Down

0 comments on commit ff62d4e

Please sign in to comment.