Getting started
flutter_date_formatter formats, parses and computes dates in 55+ locales. It works in any Dart or Flutter project and adds no setup step: the intl date data is loaded on first use.
Every example on this site runs the real package, compiled from Dart to JavaScript. Change the inputs, switch the locale in the dark bar, and copy the code.
Install
dart pub add flutter_date_formatter
# or, in a Flutter app
flutter pub add flutter_date_formatter
import 'package:flutter_date_formatter/flutter_date_formatter.dart';
final date = DateTime(2025, 3, 21, 15, 30);
date.format(pattern: 'do MMMM yyyy'); // 21st March 2025
date.formatRelative(locale: 'vi'); // 3 giờ trước
date.formatCalendar(); // Yesterday at 3:30 PM
const Duration(hours: 2, minutes: 5).humanize(); // 2 hours 5 minutes
Try it
final date = DateTime(2026, 10, 7, 5, 30, 52);
date.format(pattern: 'do MMMM yyyy', locale: 'en');
// or keep one formatter and reuse it
final formatter = FlutterDateFormatter('do MMMM yyyy', 'en');
formatter.format(date);
Explore the API
intl patterns plus do ordinals and [literal] text.
"5 minutes ago", "in 3 days", long or short.
▦Calendar time"Today at 3:00 PM", "Last Monday at…", aware of the week.
⏱Durations"2 hours 5 minutes" with correct plurals in every locale.
⇥ParsingRead strings back with the same pattern syntax.
ƒDateTime helpersWeek numbers, quarters, DST-safe arithmetic and comparisons.
↔TimeSpan & rangesInterval set operations, iteration and clamping.
文LocalesEvery locale side by side, plus lookup and fallback rules.