date_format
2.0.9, released 2 years ago by an unverified publisher
Simple API to format DateTime objects with custom format tokens.
What it does
The package exposes a formatDate function that takes a DateTime and a list of format tokens to produce a string. It supports many locales and time‑zone formatting.
AI-written summary of version 2.0.9, based on the package's README and metadata. Report an inaccuracy
Use it when
- Formatting dates for display
- Custom date patterns without external dependencies
- Locale‑aware formatting for multiple languages
Skip it when
- Need to parse date strings
- Require complex date manipulation or arithmetic
- Using intl for advanced formatting
Strengths
- Easy to use API
- Supports many locales (English, French, German, etc.)
- No external dependencies
Weaknesses
- Only formats, no parsing
- Limited to DateTime, no Duration formatting
- No support for custom locale data beyond provided ones
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
print(formatDate(DateTime(1989, 02, 21), [yyyy, '-', mm, '-', dd]));Alternatives
Packages that do the same job and could replace date_format.
- validators2
String validation and sanitization for Dart.
83Compare - datify
Extracts dates in various formats from raw strings.
66Compare - change_case
Extension on String to convert between many common case styles
59Compare - any_date
Parse strings in any format or language into DateTime objects, respecting ISO and RFC standards.
57Compare
Works with
Packages commonly used together with date_format: ones it builds on, ones built on it, and its own family.