getTimeFromTimestamp static method

String getTimeFromTimestamp(
  1. int timestamp, {
  2. bool is24HourFormat = false,
})

Implementation

static String getTimeFromTimestamp(int timestamp,
    {bool is24HourFormat = false}) {
  DateTime date = DateTime.fromMillisecondsSinceEpoch(timestamp);

  return is24HourFormat
      ? DateFormat('HH:mm').format(date)
      : DateFormat('hh:mm a').format(date);
}