toDateTime method

String toDateTime({
  1. String format = 'dd MMM yyyy | hh:mm aaa',
})

Implementation

String toDateTime({String format = 'dd MMM yyyy | hh:mm aaa'}) => this > 0
    ? DateFormat(format)
        .format(DateTime.fromMillisecondsSinceEpoch(this).toLocal())
    : toString();