json日期格式转换成日期字符串
程序员文章站
2022-03-21 15:17:04
...
这里进行去掉json日期的\date\字符串: strDate = dr["NewsTime"].ToString().Replace("/Date(", "").Replace("/","").Replace("\\","").Replace(")",""); 下面进行转换: public DateTime ConvertTime(long milliTime) { long timeTricks = new DateTime(1970, 1, 1).Ticks + milliTime * 10000 + TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now).Hours * 3600 * (long)10000000; return new DateTime(timeTricks); }
推荐阅读