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