format method

String format(
  1. String pattern
)

Returns a String which represents the date formatted by the given pattern. Patterns can be found here (intl documentation).

For example: DateTime(2001, 11, 16).format('dd.MM.yy') --> 16.11.01.

Implementation

String format(String pattern) => DateFormat(pattern).format(this);