forked from I2P_Developers/i2p.i2p
Util: Consolidate and standardize date/time formatting (ticket #2016)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user