Code example for SimpleDateFormat

Methods: format

0
      throw new RuntimeException(e);
    } 
  } 
 
  public static String formatDate(Date date) {
    SimpleDateFormat format = new SimpleDateFormat(dateFormatString);
    return format.format(date);
  } 
 
  public static boolean datesNullOrEqual(Date d1, Date d2) {
    return (d1 == null && d2 == null) || (d1 != null && d2 != null && d1.equals(d2));
  } 
}