各种时间戳及用途

        (一)

        ///


        /// 获得距离1970-01-01的毫秒数
        ///

        /// 时间参数
        ///
        public static long GetMilliSecond(DateTime newDate)
        {
            DateTime oldDate = new DateTime(1970, 1, 1);

            // Difference in days, hours, and minutes.
            TimeSpan ts = newDate.ToUniversalTime() - oldDate;

            return (long)ts.TotalMilliseconds;
        }

你可能感兴趣的:(各种时间戳及用途)