What is this Date time:
"2024-08-29 13:15:05 +0000 UTC" OR
"2024-08-29 01:33:40.774468453 -0400 EDT"
How I can convert & reformat it in flutter, what is the date format it will take ??
tried native flutter classes & intl library
What is this Date time:
"2024-08-29 13:15:05 +0000 UTC" OR
"2024-08-29 01:33:40.774468453 -0400 EDT"
How I can convert & reformat it in flutter, what is the date format it will take ??
tried native flutter classes & intl library
2
Answers
You have to add the intl package to your pubspec.yaml:
You can use the DateTime.parse() method to convert the date strings into DateTime objects. However, since the second format includes fractional seconds and a timezone, you might want to use DateTime.parse() directly, as it supports ISO 8601 format well.
To handle dynamic fractional seconds in your date strings, you can extract the fractional seconds separately and add them to the parsed DateTime object.