format method

String format(
  1. [String template = 'MM/dd/yyyy KK:mm a',
  2. String locale = 'en_US']
)

Applies a DateFormat to this DateTime.

Implementation

String format([String template = 'MM/dd/yyyy KK:mm a', String locale = 'en_US']) {
  return DateFormat(template, locale).format(this);
}