From baf40e1eb0263463b668668b02628b769d39dadc Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 26 Dec 2022 22:43:07 +0100 Subject: [PATCH] Improved hiding time zone --- app/src/main/java/eu/faircode/email/EntityMessage.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/EntityMessage.java b/app/src/main/java/eu/faircode/email/EntityMessage.java index 45b44d1676..012416a703 100644 --- a/app/src/main/java/eu/faircode/email/EntityMessage.java +++ b/app/src/main/java/eu/faircode/email/EntityMessage.java @@ -44,6 +44,7 @@ import org.jsoup.nodes.Element; import java.io.File; import java.io.Serializable; import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; @@ -495,7 +496,9 @@ public class EntityMessage implements Serializable { boolean language_detection = prefs.getBoolean("language_detection", false); String l = (language_detection ? language : null); - DateFormat DTF = Helper.getDateTimeInstance(context); + DateFormat DTF = (hide_timezone + ? new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US) + : Helper.getDateTimeInstance(context)); DTF.setTimeZone(hide_timezone ? TimeZone.getTimeZone("UTC") : TimeZone.getDefault()); String date = (received instanceof Number ? DTF.format(received) : "-");