Option<DateTime> StrToDateTime(String format, String value) { var date; try { date = DateFormat(format).parse(value); return some(date); } on Exception { return none(); } }