日時のフォーマット例

fmt1 = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
System.out.println(fmt2.format(new Date()));

SimpleDateFormat fmt2
    = new SimpleDateFormat ("hh:mm:ss a", Locale.US);
fmt.setLenient(false);
System.out.println( fmt.format(new Date()) );

[←] [目次] [→]