getDateAmPm function

String getDateAmPm([
  1. int? time
])

Implementation

String getDateAmPm([int? time]) {
  time ??= getCurrentTimeMillis();

  _initializeDateFormatting();

  var date = DateTime.fromMillisecondsSinceEpoch(time);
  var dateFormat = DateFormat('jm');
  var s = dateFormat.format(date);
  return s.contains('PM') ? 'PM' : 'AM';
}