public string ClearFixValueForSave(string title, OptionType type, string value) { if (!string.IsNullOrWhiteSpace(value)) { try { switch (type) { case OptionType.DateTime: return(Convert.ToDateTime(value, Thread.CurrentThread.CurrentCulture.DateTimeFormat) .ToString("yyyy-MM-dd")); // ISO 8601 default: return(value); } } catch { var message = string.Format(RootGlobalization.Option_Invalid_Message, title, type.ToGlobalizationString()); throw new ValidationException(() => message, message); } } return(null); }