我有 Excel 文件,我从中获取字符串格式的日期为“30-12-1899 07:50:00:AM”
当我尝试将其转换为时,DATETIME
它会给出错误
String was not recognized as a valid DateTime
我正在尝试像这样转换它
Convert.ToDateTime(homeToSchool[7],new DateTimeFormatInfo { ShortDatePattern = "dd-MM-yyyy", DateSeparator = "-" })