Skip to content
pubscout

any_date

1.2.2, released 8 months ago by el-darto.net

Parse strings in any format or language into DateTime objects, respecting ISO and RFC standards.

WASM-ready
$ flutter pub add any_date
Source repository

What it does

Parses date and time strings across various international formats and languages into standard DateTime objects. It supports locale-specific parsing, ISO and major RFC standards, and UNIX timestamps in seconds, milliseconds, microseconds, or nanoseconds.

AI-written summary of version 1.2.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to parse user-inputted dates that may come in unpredictable or mixed formats.
  • You need locale-aware date parsing for multiple languages.
  • You are handling dates adhering to major RFC or ISO standards alongside casual strings.

Skip it when

  • You only ever deal with strict, uniform ISO 8601 date strings that Dart's built-in DateTime.parse can handle.

Strengths

  • Flexible parsing inspired by Python's dateutil library
  • Extensive locale support via the intl package
  • Handles ambiguous date cases via configuration rules

Weaknesses

  • Requires the intl dependency for multi-language support
  • May require configuration rules to resolve ambiguous date formats like dd/mm/yy vs mm/dd/yy

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2
const parser = AnyDate();
final date = parser.parse('13 Aug 2023');

Alternatives

Packages that do the same job and could replace any_date.

Works with

Packages commonly used together with any_date: ones it builds on, ones built on it, and its own family.