I am developing a flutter news app. The format of date from Api response is ( 2021-02-05T09:41:13+0000 ) and I want to convert it to DD-MM-YYYY format. Can anybody help me with this?
Asked
Active
Viewed 757 times
2 Answers
0
You can use this code :
final DateTime now = DateTime.now();
final DateFormat formatter = DateFormat('dd-MM-yyyy');
final String formatted = formatter.format(now);
return formatted;

Jay Dangar
- 3,271
- 1
- 16
- 35