fix(android, timezones): timezone offset already millis, do not adjust it (#4055)

Fixes #4053 with issue noticed and fix provided by @AidanHost
This commit is contained in:
Mike Hardy
2020-08-05 14:06:08 -05:00
committed by GitHub
parent d5e070c00e
commit 8b0e1893b8

View File

@@ -98,7 +98,7 @@ public class SharedUtils {
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);