0

I am using API for getting time but the time is coming in 24hr. I want to convert to 12hr.

Need a code example for this

1 Answers1

0

You can use DateFormat(from package:intl/intl.dart) to display in 12hr format.

DateFormat('h:mm a').format(DateTime.now());
Alex Sunder Singh
  • 2,378
  • 1
  • 7
  • 17