parseAndFormat static method

String parseAndFormat(
  1. String date, {
  2. dynamic formatFrom = 'yyyy-MM-dd HH:mm:ss',
  3. dynamic formatTo = 'yyyy-MM-dd HH:mm:ss',
  4. dynamic locale = 'id_ID',
})

Implementation

static String parseAndFormat(String date, {formatFrom = 'yyyy-MM-dd HH:mm:ss', formatTo = 'yyyy-MM-dd HH:mm:ss', locale = 'id_ID'}) {
  DateTime dateTime = parse(date, format: formatFrom, locale: locale);
  return format(dateTime, format: formatTo, locale: locale);
}