Code example for SimpleDateFormat

Methods: toPattern

0
 
  private static void printDate(final Properties writer, int type, Locale locale)
  { 
    SimpleDateFormat sdf = (SimpleDateFormat) DateFormat.getDateInstance(type, locale);
 
    writer.put ("format.date." + typeToString(type) ,sdf.toPattern());
  } 
 
  private static void printTime(final Properties writer, int type, Locale locale)
  { 
    SimpleDateFormat sdf = (SimpleDateFormat) DateFormat.getTimeInstance(type, locale);
    writer.put ("format.time." + typeToString(type) , sdf.toPattern());
  } 
}