The string was not recognized as a valid DateTime. There is an unknown word starting at index 0

前端 未结 5 1017
予麋鹿
予麋鹿 2021-01-19 10:53

I have the following C# that is giving me the error above when trying to parse string to datetime.

DateTime backupdate = System.Convert.ToDateTime(imageflowl         


        
5条回答
  •  萌比男神i
    2021-01-19 11:13

    Your problem is with the time part of your dateTime string. If your string read "2012-04-15 15:23:34.123" then it would work. You could modify your string and replace the last colon with a period and that would fix it.

提交回复
热议问题