any_date 0.1.8 any_date: ^0.1.8 copied to clipboard
A package for parsing String into DateTime in any format. Inspired by python's dateutil.parser, while also making it compatible with DateTime.parse.
Package to improve DateTime manipulation, especially by allowing parsing any format. Heavily inspired by python's dateutil package.
Features #
Still experimental and on early stages, but this package is meant to parse any timestamp into a DateTime object. Only depends on intl
for testing, but the package has minimum constraints to work with pure Dart projects as well.
Usage #
Usage is simple, use the AnyDate()
constructor to create a parser with the desired settings, and use it to parse any String
into DateTime
, regardless of the format.
Note that, in order to resolve ambiguity, some settings are required either on the AnyDate()
constructor or on the AnyDate.defaultSettings
static attribute.
const parser = AnyDate();
final date = parser.parse('13 Aug 2023');
// date is parsed as DateTime(2023, 08, 13)