/** * Giving back a date/time string in the format following the rule from the most to the least significant * * @param date * the date to convert * @return a string in the form yyyddMM_hhmmss */ public static String getFormattedDateTime( Date date ) { return getFormattedDateTime( date, false ); }
/** * Giving back the actual time as a date/time string in the format following the rule from the most to the least * significant * * @return a string in the form yyyddMM_hhmmss */ public static String getFormattedDateTimeNow() { return getFormattedDateTime( new Date(), false ); }
/** * Giving back the actual time as a date/time string in the format following the rule from the most to the least * significant * * @param milliseconds * true when milliseconds should be added * @return a string in the form yyyddMM_hhmmssSSS (milliseconds will be optional) */ public static String getFormattedDateTimeNow( boolean milliseconds ) { return getFormattedDateTime( new Date(), milliseconds ); }
@Override public String toString() { if ( Utils.isEmpty( subject ) ) { return description + " @ " + StringUtil.getFormattedDateTime( date, true ) + " : " + ( duration == null ? "-" : duration.toString() ) + ( count == null ? "" : " (x" + count + ")" ); } else { return description + " / " + subject + " @ " + StringUtil.getFormattedDateTime( date, true ) + " : " + ( duration == null ? "-" : duration.toString() ) + ( count == null ? "" : " (x" + count + ")" ); } }
@Override public String toString() { LoggingObjectInterface loggingObject = LoggingRegistry.getInstance().getLoggingObject( logChannelId ); String subject = null; if ( loggingObject != null ) { subject = loggingObject.getObjectName() + "(" + loggingObject.getObjectType() + ")"; } else { subject = "-"; } return subject + " - " + getKey() + " @ " + StringUtil.getFormattedDateTime( date, true ) + " : " + type.toString(); }