mvc获取时间戳

时间:2014-11-10 01:01:31   收藏:0   阅读:438
1 DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
2                                     DateTime dtNow = DateTime.Parse(DateTime.Now.ToString());
3                                     TimeSpan toNow = dtNow.Subtract(dtStart);
4                                     string timeStamp = toNow.Ticks.ToString();
5                                     timeStamp = timeStamp.Substring(0, timeStamp.Length - 7);

 

原文:http://www.cnblogs.com/mrcln/p/4086161.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!