String? toFormat(String format) { try { final parsedDate = DateFormat(format).format(this); return parsedDate; } catch (exception) { return null; } }