manifoldcf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Wright <daddy...@gmail.com>
Subject Re: ManifoldCF 2.11, DatTime format in Status and Job Management
Date Fri, 30 Nov 2018 14:14:13 GMT
The dates/times for this page are formatted as follows:

org.apache.manifoldcf.ui.util.Formatter.formatTime(clientTimezone,
pageContext.getRequest().getLocale(), js.getStartTime());

But the code for formatTime pays no attention to the preferred format for
the locale:

  public static String formatTime(TimeZone tz, Locale locale, long time)
  {
    Calendar c = new GregorianCalendar(tz, locale);
    c.setTimeInMillis(time);
    // We want to format this string in a compact way:
    // mm-dd-yyyy hh:mm:ss.mmm
    StringBuilder returnString = new StringBuilder();
    writechars(returnString,c.get(Calendar.MONTH)+1,2);
    returnString.append("-");
    writechars(returnString,c.get(Calendar.DAY_OF_MONTH),2);
    returnString.append("-");
    writechars(returnString,c.get(Calendar.YEAR),4);
    returnString.append(" ");
    writechars(returnString,c.get(Calendar.HOUR_OF_DAY),2);
    returnString.append(":");
    writechars(returnString,c.get(Calendar.MINUTE),2);
    returnString.append(":");
    writechars(returnString,c.get(Calendar.SECOND),2);
    returnString.append(".");
    writechars(returnString,c.get(Calendar.MILLISECOND),3);
    return returnString.toString();
  }


So if you would like this to be changed you might want to create an
enhancement request.

Thanks,
Karl




On Fri, Nov 30, 2018 at 8:43 AM SAUNIER Maxence <MSAUNIER@q1c1.fr> wrote:

> Hello Karl,
>
>
>
> Can I change the datetime format « MM-dd-yyyy hh:mm:sss » to have
> « yyyy-MM-dd hh:mm:ss » or « dd-MM-yyyy hh:mm:ss » ?
>
>
>
> Thanks,
>

Mime
View raw message