C# 获取当前时间戳

        /// <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

 

C# 获取当前时间戳

上一篇:openstack-glance上传镜像


下一篇:IDEA 隐藏编辑器顶部 Tab 栏