sujith sa
sujith sa

Reputation: 37

How to convert the specific String to DateTime Format in flutter

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

How can I convert the above string to DateTime Format?

Upvotes: 0

Views: 204

Answers (1)

mahesh
mahesh

Reputation: 4763

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

Upvotes: 3

Related Questions