DateTime timeStamp = new DateTime(1970,1,1); //得到1970年的时间戳long a = (DateTime.UtcNow.Ticks - timeStamp.Ticks) / 10000000;注意这里如果有时区问题,用now就要减掉8个小:long a=(DateTime.Now.Ticks-aa.Ticks)/10000000-8*60*60;