我正在使用F#中的fileHelpers模块解析CSV。想知道什么是将时间转换为最佳格式的最佳方法。我认为最好的格式是timeSpan,但是无法找到时间跨度的convertKindFileHelpers CSV时间跨度
如果我有一个字符串,例如10:05.0 这代表上午10:05。使用ConvertKind和FileHelpers Library来解析这个字符串到一个代表10:05
感谢您的所有帮助的最佳方式是什么?
我正在使用F#中的fileHelpers模块解析CSV。想知道什么是将时间转换为最佳格式的最佳方法。我认为最好的格式是timeSpan,但是无法找到时间跨度的convertKindFileHelpers CSV时间跨度
如果我有一个字符串,例如10:05.0 这代表上午10:05。使用ConvertKind和FileHelpers Library来解析这个字符串到一个代表10:05
感谢您的所有帮助的最佳方式是什么?
您可以实现您的自定义转换器的转换(继承ConverterBase),然后use it in your FieldConverter attribute
那就是解决方案,使用你自己的Converter。检查这个例子:http://filehelpers.sourceforge.net/example_customconv.html – MarcosMeli 2012-03-28 12:25:46
如果老是 “HH:mm.0”,然后TimeSpan.TryParse( “10:05.0”“。 '.Replace(' :')) – BLUEPIXY 2012-03-28 09:57:27