format method
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;
}