public static DateTime Parse(string s, DateTime defaultValue) { s = MonthsInEnglish.CorrectAbbreviatedName(s); DateTime d; return(TryParse(s, out d) ? d : defaultValue); }
public static DateTime ParseTime(string s, DateTime?dateValue = null, DateTime?defaultTime = null) { var def = defaultTime ?? DateTime.MinValue; var date = dateValue ?? DateTime.MinValue; s = MonthsInEnglish.CorrectAbbreviatedName(s); DateTime time; if (!TryParse(s, out time)) { time = def; } return(UniteDateAndTime(date, time)); }