getAmPm static method

String getAmPm(
  1. TimeOfDay time
)

Returns 'AM' or 'PM' based on the period of the given TimeOfDay.

Implementation

static String getAmPm(TimeOfDay time) {
  return time.period == DayPeriod.am ? 'AM' : 'PM';
}