String was not recognized as a valid DateTime.c#中

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 22:56:56

String was not recognized as a valid DateTime.c#中
String was not recognized as a valid DateTime.
c#中

String was not recognized as a valid DateTime.c#中
就是你把字符串转换成时问格式出错,字符串不是有效的时间格式嘛
解决办法就是你把时间格式写对就好了
如Convert.ToDateTime("2008/01/02");
Convert.ToDateTime("2008-01-02");