-1

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?

0

2 Answers 2

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;
Sign up to request clarification or add additional context in comments.

Comments

0
String date = DateFormat.yMd().format('your date here');

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.