DateTime? fromFormat(String format) { try { final parsedDate = DateFormat(format).parse(this); return parsedDate; } catch (exception) { debugPrint('$exception'); return null; } }