转换此字符串的最佳方法是什么
Dim MyString As String = "20150728-02:21:44.952"
进入这个
"2015/07/28 02:21:44.952"
答案 0 :(得分:5)
C#等价物:
var date = DateTime.ParseExact("20150728-02:21:44.952",
"yyyyMMdd-HH:mm:ss.fff",
System.Globalization.CultureInfo.InvariantCulture);
var dateAsString = date.ToString("yyyy/MM/dd HH:mm:ss.fff");
这就是Telerik转换器给我的:
Dim [date] = DateTime.ParseExact("20150728-02:21:44.952",
"yyyyMMdd-HH:mm:ss.fff",
System.Globalization.CultureInfo.InvariantCulture);
Dim dateAsString = [date].ToString("yyyy/MM/dd HH:mm:ss.fff");