DateParsingTextX extension
Extension methods for parsing String values into DateTime instances.
Provides multiple parsing strategies:
- toDateTime - Strict ISO 8601 / RFC 3339 parsing.
- toDateFormatted - Custom pattern parsing via DateFormat.
- toDateAutoFormat - Heuristic auto-detection for diverse formats.
Used internally by Convert.toDateTime to implement date conversion.
See also: DateOptions for configuring default parsing behavior.
- on
Methods
-
toDateAutoFormat(
{String? locale, bool useCurrentLocale = false, bool utc = false}) → DateTime -
Available on String, provided by the DateParsingTextX extension
Attempts to parse the date using a variety of known formats. -
toDateFormatted(
String format, String? locale, {bool utc = false}) → DateTime -
Available on String, provided by the DateParsingTextX extension
Parses this string using the suppliedformatandlocale. -
toDateTime(
) → DateTime -
Available on String, provided by the DateParsingTextX extension
Parses this string into a DateTime using standard ISO 8601 or RFC 3339 formats. -
tryToDateAutoFormat(
{String? locale, bool useCurrentLocale = false, bool utc = false}) → DateTime? -
Available on String, provided by the DateParsingTextX extension
Attempts toDateAutoFormat while swallowing parsing errors. -
tryToDateFormatted(
String format, String? locale, {bool utc = false}) → DateTime? -
Available on String, provided by the DateParsingTextX extension
Attempts to parse this string usingformatandlocale, returningnullon failure. -
tryToDateTime(
) → DateTime? -
Available on String, provided by the DateParsingTextX extension
Attempts to parse this string into a DateTime, returningnullon failure.