toDateTime method
Parses this string into a DateTime using standard ISO 8601 or RFC 3339 formats.
Delegates to DateTime.parse after trimming whitespace. Supports timezone
offsets (e.g., +05:30, Z) and fractional seconds.
Throws FormatException if the input is invalid.
Implementation
DateTime toDateTime() => DateTime.parse(trim());