timeStampToDate static method

String timeStampToDate(
  1. int? timeInMillis, {
  2. String? format,
})

Implementation

static String timeStampToDate(int? timeInMillis, {String? format}) {
  if (timeInMillis == null) return '';
  try {
    DateTime date = DateTime.fromMillisecondsSinceEpoch(timeInMillis);
    return DateFormat(format ?? 'dd/MM/yyyy').format(date);
  } catch (e) {
    return e.toString();
  }
}