getFormattedDateString static method

String getFormattedDateString(
  1. DateTime date, {
  2. String pattern = 'dd-MM-yyyy',
})

Convert date to String according to pattern.

Implementation

static String getFormattedDateString(
  DateTime date, {
  String pattern = 'dd-MM-yyyy',
}) {
  final formatter = DateFormat(pattern);
  return formatter.format(date);
}