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