/// <summary>
/// 是不是日期类型
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool IsDatetime(string value)
{
DateTime result;
return IsDatetime(value, out result);
}
/// <summary>
/// 是不是日期类型
/// </summary>
/// <param name="value"></param>
/// <param name="result"></param>
/// <returns></returns>
public static bool IsDatetime(string value, out DateTime result)
{
var isDate = DateTime.TryParse(value, out result);
if (isDate == false)
{
return false;
}
var userDateTime = result.ConvertFromUserTimeZone();
return (SqlDateTime.MinValue.Value < userDateTime && userDateTime < SqlDateTime.MaxValue.Value);
}