DateTime.ParseExact string format exception

后端 未结 3 1498
执念已碎
执念已碎 2020-12-19 06:32

I am trying to convert a string into datetime with the following C# code,

DateTime dTo = DateTime.ParseExact(dateTo, \"mm/dd/yyyy\", CultureInfo.InvariantCul         


        
3条回答
  •  借酒劲吻你
    2020-12-19 07:06

    Capital M is month, little m is mins i think.

    But to the point of the question, use Parse. ParseExact implies you know the exact format of the input.

提交回复
热议问题