时间戳
作者:互联网
//获取当前时间戳(都可以)
var timeStamp = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
var UnixTimeStamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
//转换成年月日时分秒
DateTime dt = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
TimeSpan ts = new TimeSpan(long.Parse(UnixTimeStamp + “0000000”));
DateTime nowTime = dt.Add(ts);
标签:UnixTimeStamp,TimeSpan,ts,DateTime,时间,var,new 来源: https://blog.csdn.net/lllyyyttt000/article/details/103984546