0
String date  = 'July 7,2020 10:00 AM'

How can I convert the above string to DateTime Format?

sujith sa
  • 37
  • 1
  • 7

1 Answers1

3
String date = 'July 7,2020 10:00 AM';
DateFormat d = DateFormat('MMMM d,yyyy hh:mm a');
print(d.parse(date));

For more info : https://api.flutter.dev/flutter/intl/DateFormat-class.html

mahesh
  • 4,625
  • 11
  • 42
  • 61