Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Flutter – date format for print date like MMMdy

I need to display date like 22 Dec 2021. How could I achieve this?
DateFormat.yMMMd().format(date)
this gives date like Dec 22, 2021.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Yes, first import package:intl/intl.dart then :

 DateTime now = DateTime.now();
 String formatted = DateFormat('dd MMM yyyy').format(now);
 print(formatted); // prints 22 Dec 2021
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading