Skip to main content
Version: 0.2.0

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, copy the generated Dart code, or use share to copy the current locale, clock, and week settings into a URL. Reset returns the shared settings to their defaults.

Install​

Add the package
dart pub add flutter_date_formatter
# or, in a Flutter app
flutter pub add flutter_date_formatter
Import it
import 'package:flutter_date_formatter/flutter_date_formatter.dart';
Format a date
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​

LOADING…
⚙ TRY IT
⚡ OUTPUT
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​