Home > database >  Convert "11:00 to 12:00" TO "11:00 am to 12:00 pm"
Convert "11:00 to 12:00" TO "11:00 am to 12:00 pm"

Time:07-01

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());
  • Related