Why does TimeSpan.ParseExact not work

前端 未结 5 1040
既然无缘
既然无缘 2020-11-29 10:00

This is a bit wierd. Parsing a text field with a valid timespan fails if I try to be precise!

const string tmp = \"17:23:24\";
//works
var t1 = TimeSpan.Pars         


        
5条回答
  •  情书的邮戳
    2020-11-29 10:43

    Try this:

         var t2 = TimeSpan.ParseExact(tmp, "HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
    

提交回复
热议问题