I want to convert given date string: "11:00 to 12:00"
to
"11:00 am to 12:00 pm".
I have tried several methods which convert ISODateString. But I am unable to work out this one. Any help would be appreciated.
CodePudding user response:
You have to only change format like this:- DateFormat("h:mm a");
It is returns 11:00 AM
CodePudding user response:
use this package https://pub.dev/packages/intl
use it like below,
var format = DateFormat("h:mm a");
var dateString = format.format(DateTime.now());