String was not recognized as a valid DateTime

前端 未结 3 849
野趣味
野趣味 2020-12-21 18:02

I am converting the uk date format string to US format to save this into database but it throw me error \"String was not recognized as a valid DateTime.\"

st         


        
3条回答
  •  無奈伤痛
    2020-12-21 18:52

    try this

    DateTime dt = DateTime.Parse(dtString,
    System.Threading.Tread.CurrentThread.CurrentCultur e.DateTimeFormat);
    

提交回复
热议问题