C# 时间戳转换
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)); // Javascript时间戳 long timeStamp = (long)(DateTime.Now - startTime).TotalMilliseconds; DateTime dt = startTime.AddMilliseconds(timeStamp); // Unix时间戳 long timeStamp = (long)(DateTime.Now - startTime).Seconds; DateTime dt = startTime.AddSeconds(timeStamp);