---
title: "How to use localized date in Flutter?"
description: "Learn how to use localized date in Flutter with the DateFormat class. Format dates in the user's locale and display them in a familiar format. Examples included."
category: flutter
date: 2023-03-29
updated: 2026-10-09
canonical: https://localizely.com/i18n-questions/flutter/how-to-use-localized-date-in-flutter/
---

# How to use localized date in Flutter?

To use localized date in Flutter, you can utilize the `DateFormat` class from the [intl](https://pub.dev/packages/intl) package. This class allows you to format dates according to the user's locale, making it easy to display dates in a localized format that the user is familiar with. Here is an example of how to use the `DateFormat` class in Flutter:

```dart
DateTime now = DateTime.now();

String formattedDateEn = DateFormat.yMd('en').format(now);
print(formattedDateEn); // 3/28/2023

String formattedDateFr = DateFormat.yMd('fr').format(now);
print(formattedDateFr); // 28/03/2023
```

You can also format dates in your localization messages using either the [gen_l10n](/blog/flutter-localization-step-by-step/?tab=using-gen-l10n) or [Flutter Intl](/blog/flutter-localization-step-by-step/?tab=automated-using-flutter-intl) approaches and generated localization code will handle that for you. Here is an example of such a message in ARB file:

```json
"pageHomeSampleCurrentDate": "Date: {date}",
"@pageHomeSampleCurrentDate": {
  "placeholders": {
    "date": {
      "type": "DateTime",
      "format": "yMd"
    }
  }
}
```

Source: https://localizely.com/i18n-questions/flutter/how-to-use-localized-date-in-flutter/
