mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-23 20:10:05 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user