From 26710761ed9c6f8ac33b5ed5d4b363bdb462c7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD-=E7=99=BD?= Date: Sat, 26 Nov 2022 01:29:55 +0800 Subject: [PATCH] Fix wrong timezone --- .../main/java/com/hippo/ehviewer/client/parser/ParserUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/hippo/ehviewer/client/parser/ParserUtils.java b/app/src/main/java/com/hippo/ehviewer/client/parser/ParserUtils.java index b72c3f965..19f48294c 100644 --- a/app/src/main/java/com/hippo/ehviewer/client/parser/ParserUtils.java +++ b/app/src/main/java/com/hippo/ehviewer/client/parser/ParserUtils.java @@ -23,12 +23,14 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; +import java.util.TimeZone; public class ParserUtils { public static final DateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US); public static synchronized String formatDate(long time) { + sDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return sDateFormat.format(new Date(time)); }