/// <summary>
/// 判断字符串时间格式是否合法
/// </summary>
/// <param name="source">字符串时间</param>
/// <param name="format">yyyy-MM-dd或yyyy-MM-dd HH:mm:ss</param>
/// <returns></returns>
public bool IsValidDateTiem(string source,string format)
{
DateTime parsed;
bool valid = DateTime.TryParseExact(source, format, CultureInfo.InvariantCulture,
DateTimeStyles.None,
out parsed);
return valid;
}