【发布时间】:2013-11-21 14:34:42
【问题描述】:
我似乎无法为我的TimeSpan.ParseExact() 设置正确的自定义格式:
预期的时间样本:
1:23:45.6
23:45.6
23:45
1:23:45
我使用的字符串格式:
string withTenthFormat = @"[%h\:]mm\:ss[\.%f]";
尝试选择几小时和几分之一秒。然而,使用这种格式和CultureInfo.InvariantCulture 确实会导致FormatException。我错过了什么?
【问题讨论】: