dateTimeFormat static method

String dateTimeFormat({
  1. required String dateTime,
  2. String inFormat = Format.fyyyyMMdd,
  3. String outFormat = Format.fyyyyMMdd,
})

format date (String)

Implementation

static String dateTimeFormat(
    {required String dateTime,
    String inFormat = Format.fyyyyMMdd,
    String outFormat = Format.fyyyyMMdd}) {
  if (_isNullOrEmpty(dateTime)) {
    return "";
  } else {
    return dateTimeToString(
        date: stringToDateTime(date: dateTime, format: inFormat),
        format: outFormat);
  }
}