Skip to content

Commit

Permalink
fix(android, timezones): timezone offset already millis, do not adjus…
Browse files Browse the repository at this point in the history
…t it (#4055)

Fixes #4053 with issue noticed and fix provided by @AidanHost
  • Loading branch information
mikehardy authored Aug 5, 2020
1 parent d5e070c commit 8b0e189
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static WritableMap getExceptionMap(Exception exception) {

public static String timestampToUTC(long timestamp) {
Calendar calendar = Calendar.getInstance();
Date date = new Date((timestamp + calendar.getTimeZone().getOffset(timestamp)) * 1000);
Date date = new Date(timestamp + calendar.getTimeZone().getOffset(timestamp));
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
format.setTimeZone(TimeZone.getTimeZone("UTC"));
return format.format(date);
Expand Down

0 comments on commit 8b0e189

Please sign in to comment.