我有一个我写过的C#应用程序,但我的Convert.ToDateTime工作时间过去了09:59?
这是我的代码:
strDateTime = Convert.ToDateTime(arr[3].TrimStart('[').Substring(0, 11) + " " + arr[3].TrimStart('[').Substring(13, 7));
Run Code Online (Sandbox Code Playgroud)
这就是arr[3]:
[20/Feb/2014:14:21:32 +0100]
这让我疯狂!
谢谢
string s = "[20/Feb/2014:14:21:32 +0100]";
DateTime d = DateTime.ParseExact(s, @"[dd\/MMM\/yyyy\:HH\:mm\:ss zzzz]", null);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
140 次 |
| 最近记录: |