Issue
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
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
Answered By - esentis
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.