Converting a String to DateTime

后端 未结 17 2569
南方客
南方客 2020-11-21 06:12

How do you convert a string such as 2009-05-08 14:40:52,531 into a DateTime?

17条回答
  •  不知归路
    2020-11-21 06:40

    I tried various ways. What worked for me was this:

    Convert.ToDateTime(data, CultureInfo.InvariantCulture);
    

    data for me was times like this 9/24/2017 9:31:34 AM

提交回复
热议问题