timestampTo_HH_mm function

String timestampTo_HH_mm(
  1. int timestamp, {
  2. String unit = ':',
  3. bool isUtc = false,
})

时间戳转HH:mm

Implementation

// ignore: non_constant_identifier_names
String timestampTo_HH_mm(int timestamp,
    {String unit = ':', bool isUtc = false}) {
  DateTime dateTime = timestampToDateTime(timestamp, isUtc: isUtc);
  return '${twoDigits(dateTime.hour)}:${twoDigits(dateTime.minute)}';
}