C# 将string字符转换成DateTime

string BoxCode = "X20171215090101";
DateTime t = DateTime.ParseExact(BoxCode.Substring(1, 14), "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture).AddDays(-i);

 

posted @ 2019-05-22 17:52  forack  阅读(4981)  评论(0编辑  收藏  举报