Strange error when parsing string to date?

前端 未结 4 2009
清酒与你
清酒与你 2021-01-02 18:07

When I try to parse date like this:

DateTime t1 = DateTime.ParseExact(\"August 11, 2013, 11:00:00 PM\", \"MMMM dd, yyyy, hh:mm:ss tt\", System.Globalization.         


        
4条回答
  •  北海茫月
    2021-01-02 18:34

    I was hit with this too. In my case, a UI automation test failed because IE seems to add this LRM (Left-to-right) mark automatically (Firefox and Chrome do not). A quick line of code that strips it away:

    Regex.Replace(date, @"\u200e", string.Empty)
    

提交回复
热议问题