toNewFormat method

String? toNewFormat(
  1. String fromPattern,
  2. String toPattern
)

Implementation

String? toNewFormat(String fromPattern, String toPattern) {
  try {
    return DateFormat(toPattern).format(DateFormat(fromPattern).parse(this));
  } on Exception catch (e) {
    print(e);
    return null;
  }
}