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 (invertase#4055)

Fixes invertase#4053 with issue noticed and fix provided by @AidanHost
  • Loading branch information
mikehardy committed Aug 5, 2020
1 parent af94b86 commit 874ae2f
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 874ae2f

Please sign in to comment.