How can I convert a string into datetime in .NET?

前端 未结 2 757
花落未央
花落未央 2020-12-07 04:33

How can I convert dates like \"Jun 17 2009, 03:37 pm ET\" into a DateTime variable using C#?

I have tried DateTime.ParseExact but I haven\'

2条回答
  •  Happy的楠姐
    2020-12-07 04:55

    Have you tried DateTime.Parse()? I ususally find that it is not necessary to specify the format unless there is some abiguity between what number is the month and what number is the day.

提交回复
热议问题