Click here to Skip to main content
14,486,704 members
Rate this:
Please Sign up or sign in to vote.
See more:
I using Flutter in my project.

I would like to achieve date format below:

2020-03-26T00:57:08.000+08:00

What I have tried:

I using DateTime class
DateTime dateTime = DateTime.now();
print(dateTime.toIso8601String());
print(dateTime.toLocal());
print(dateTime.toUtc());
Output
I/flutter (20667): 2020-03-26T01:34:20.826589
I/flutter (20667): 2020-03-26 01:34:20.826589
I/flutter (20667): 2020-03-25 17:34:20.826589Z
I would like to have a date format like the first output I show.
Posted
Updated 5 days ago
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100