public static String currentDefaultFormattedTimeStamp(){
  try {
    SimpleDateFormat sdf=new SimpleDateFormat(DEFAULT_TIME_STAMP_FORMAT);
    final String formattedTimeStamp=sdf.format(new Date());
    return formattedTimeStamp;
  }
 catch (  IllegalArgumentException e) {
    SimpleDateFormat sdf=new SimpleDateFormat(SAFE_TIME_STAMP_FORMAT);
    final String formattedTimeStamp=sdf.format(new Date());
    return formattedTimeStamp;
  }
}

public static String currentDefaultFormattedTimeStamp ( ) { try { SimpleDateFormat sdf = new SimpleDateFormat ( DEFAULT_TIME_STAMP_FORMAT ) ; final String formattedTimeStamp = sdf . format ( new Date ( ) ) ; return formattedTimeStamp ; } catch ( IllegalArgumentException e ) { SimpleDateFormat sdf = new SimpleDateFormat ( SAFE_TIME_STAMP_FORMAT ) ; final String formattedTimeStamp = sdf . format ( new Date ( ) ) ; return formattedTimeStamp ; } }
gets the current time stamp based on the default format . the default format is defined in messages . properties .
