String was not recognized as a valid DateTime during insert

后端 未结 3 1565
别那么骄傲
别那么骄傲 2021-01-26 08:21

I get the following error when i try to convert to date time.

String was not recognized as a valid DateTime.

 cost.b_date =          


        
3条回答
  •  孤街浪徒
    2021-01-26 08:55

    Try using DateTime.ParseExact.

    DateTime date = DateTime.ParseExact(c_date.Text, "yyyy/MM/dd", null);
    

提交回复
热议问题