//2018/5/14 16:03:05转换:1526284985 public static double ConvertToDouble(DateTime date) { var baseTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); var ts = date - baseTime; double intervel = ts.TotalSeconds; return intervel; } public static System.DateTime ConvertIntDateTime(double d) { System.DateTime time = System.DateTime.MinValue; System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); time = startTime.AddSeconds(d); return time; }
原文:https://www.cnblogs.com/bqh10086/p/9302346.html