Improved hiding time zone

This commit is contained in:
M66B 2022-12-26 22:43:07 +01:00
parent 922a14850e
commit baf40e1eb0
1 changed files with 4 additions and 1 deletions

View File

@ -44,6 +44,7 @@ import org.jsoup.nodes.Element;
import java.io.File; import java.io.File;
import java.io.Serializable; import java.io.Serializable;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
@ -495,7 +496,9 @@ public class EntityMessage implements Serializable {
boolean language_detection = prefs.getBoolean("language_detection", false); boolean language_detection = prefs.getBoolean("language_detection", false);
String l = (language_detection ? language : null); 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()); DTF.setTimeZone(hide_timezone ? TimeZone.getTimeZone("UTC") : TimeZone.getDefault());
String date = (received instanceof Number ? DTF.format(received) : "-"); String date = (received instanceof Number ? DTF.format(received) : "-");