/// <summary> /// 获取时间戳test /// </summary> /// <returns></returns> public static Int64 _GetTimeStamp() { TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0); //return Convert.ToInt64(ts.TotalMilliseconds).ToString(); return Convert.ToInt64(ts.TotalMilliseconds); }
/// <summary> /// 获取时间戳test /// </summary> /// <returns></returns> private int _GetCreatetime() { DateTime DateStart = new DateTime(1970, 1, 1, 8, 0, 0); return Convert.ToInt32((DateTime.Now - DateStart).TotalSeconds); }
转: https://www.cnblogs.com/yinmu/p/11228196.html