C#解析日期/时间与我以前没见过的唯一格式 [英] C# Parse Date/Time with a unique format I haven't seen before

查看:109
本文介绍了C#解析日期/时间与我以前没见过的唯一格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



2011-03-08-12.26.27.000000我想用一种特殊格式解析日期/时间



2011-03-08-13.00.03.000000



C#中有一个简单的功能,谢谢我非常感谢您的帮助。



解决方案

  DateTime.ParseExact(2011-03-08-12.26.27.000000,yyyy-MM-dd-HH.mm.ss.ffffff null)

http://msdn.microsoft.com/en-us/library/w2sa9yss.aspx


I'm trying to parse a date/time with a special format I haven't seen before...

2011-03-08-12.26.27.000000

2011-03-08-13.00.03.000000

Is there an easy function in C# that I'm missing so I can convert to a date/time easily?

Thanks I really appreciate your help.

解决方案

DateTime.ParseExact("2011-03-08-12.26.27.000000", "yyyy-MM-dd-HH.mm.ss.ffffff", null)

http://msdn.microsoft.com/en-us/library/w2sa9yss.aspx

这篇关于C#解析日期/时间与我以前没见过的唯一格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆