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
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
You can use DateFormat
(from package:intl/intl.dart
) to display in 12hr format.
DateFormat('h:mm a').format(DateTime.now());