dateToString static method

String dateToString(
  1. DateTime date, {
  2. String? pattern,
  3. String? locale,
})

Implementation

static String dateToString(DateTime date, {String? pattern, String? locale}) {
  pattern ??= 'yyyy.MM.dd';
  initializeDateFormatting("en_US", null);
  return DateFormat(pattern, locale).format(date);
}