getFormattedDate static method

String getFormattedDate(
  1. DateTime date, {
  2. String format = 'dd MMM yyyy',
})

Format a DateTime as a string with the specified format (default is 'dd MMM yyyy').

Implementation

static String getFormattedDate(DateTime date,
    {String format = 'dd MMM yyyy'}) {
  return DateFormat(format).format(date);
}