toLocalizedDate method

String toLocalizedDate({
  1. String? locale,
  2. String? pattern,
  3. DateFormatStyle? style,
})

Formats this date as a localized date string.

final formatted = DateTime(2026, 8, 23).toLocalizedDate(locale: 'en-US'); // "8/23/2026"

Implementation

String toLocalizedDate({String? locale, String? pattern, DateFormatStyle? style}) =>
    formatDate(this, locale: locale, pattern: pattern, style: style);