How to convert below ISO8601 format into just month and day.
2022-08-29T10:33:49.283Z
to
29/8
CodePudding user response:
U can use package intl
final formatedDate = DateFormat('d/M').format(DateTime.now());
// ie: Prints 11/9(considering the date as today)
print(formatedDate);
CodePudding user response:
you can use intl
DateTime now = DateTime.parse('2022-08-29T10:33:49.283Z');
var formatter = DateFormat('dd/MM');
var formatted = formatter.format(now);
print(formatted);