format method

String format({
  1. String pattern = "dd MMM yyyy",
  2. String? locale,
})

Formats this date using the given pattern and locale.

The result is automatically capitalized.

Implementation

String format({String pattern = "dd MMM yyyy", String? locale}) {
  return DateFormat(pattern, locale).format(this).cap;
}