protected static String buildTimestamp ( final Calendar pCalendar ) { if ( pCalendar == null ) { return CALENDAR_IS_NULL_ERROR_MESSAGE ; } // The timestamp format StringBuilder timestamp = new StringBuilder ( ) ; //timestamp.append(DateUtil.getMonthName(new Integer(pCalendar.get(Calendar.MONTH)).toString(), "0", "us", "MEDIUM", false) + " "); timestamp . append ( DateFormat . getDateInstance ( DateFormat . MEDIUM ) . format ( pCalendar . getTime ( ) ) ) ; //timestamp.append(pCalendar.get(Calendar.DAY_OF_MONTH) + " "); timestamp . append ( " " ) ; timestamp . append ( StringUtil . pad ( new Integer ( pCalendar . get ( Calendar . HOUR_OF_DAY ) ) . toString ( ) , 2 , "0" , true ) + ":" ) ; timestamp . append ( StringUtil . pad ( new Integer ( pCalendar . get ( Calendar . MINUTE ) ) . toString ( ) , 2 , "0" , true ) + ":" ) ; timestamp . append ( StringUtil . pad ( new Integer ( pCalendar . get ( Calendar . SECOND ) ) . toString ( ) , 2 , "0" , true ) + ":" ) ; timestamp . append ( StringUtil . pad ( new Integer ( pCalendar . get ( Calendar . MILLISECOND ) ) . toString ( ) , 3 , "0" , true ) ) ; return timestamp . toString ( ) ; }
Builds a presentation of the given calendar s time . This method contains the common timestamp format used in this class .