Util: Consolidate and standardize date/time formatting (ticket #2016)

This commit is contained in:
zzz
2019-08-30 18:38:12 +00:00
parent 96d8385f49
commit a6e3621c06
25 changed files with 101 additions and 159 deletions

View File

@@ -386,12 +386,10 @@ class Mail {
private static final DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
private static final DateFormat localDateFormatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
private static final DateFormat longLocalDateFormatter = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT);
static {
// the router sets the JVM time zone to UTC but saves the original here so we can get it
TimeZone tz = SystemVersion.getSystemTimeZone();
localDateFormatter.setTimeZone(tz);
longLocalDateFormatter.setTimeZone(tz);
}
/**
@@ -403,8 +401,8 @@ class Mail {
synchronized(dateFormatter) {
formattedDate = dateFormatter.format( date );
localFormattedDate = localDateFormatter.format( date );
quotedDate = longLocalDateFormatter.format(date);
}
quotedDate = DataHelper.formatTime(dateLong);
}
/**