我需要在 C# 中将我的字符串转换为时间跨度,这是我的字符串 52:13:27.0000000
当我尝试 Timespan.parse 时出现错误
The TimeSpan could not be parsed because at least one of the numeric components is out of range or contains too many digits.
求助! 谢谢
最佳答案
TimeSpan.Parse()
接受 Days:Hours:Minutes:Seconds:Miliseconds
如果你想超过 24 小时,你必须添加一天。
在您的特定情况下,它应该类似于以下内容:
TimeSpan.Parse("2:04:13:27.0000000");
关于c# - 将字符串转换为时间跨度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35098786/