标签:字符串 lis seconds system nbsp time() long addm 时区
字符串转日期:
long ltime = Convert.ToInt64("1481097219000");
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)).ToLocalTime(); // 当地时区
DateTime dt = startTime.AddMilliseconds(ltime);
日期转 long
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区
long showTime = (long)(System.DateTime.Now - startTime).TotalMilliseconds;
标签:字符串 lis seconds system nbsp time() long addm 时区
原文地址:http://www.cnblogs.com/valor-xh/p/6142853.html