返回时间差[返回秒]

        /// <summary>
        /// 返回时间差[返回秒]
        /// </summary>
        /// <param name="DateTimex">时间1(小)</param>
        /// <param name="DateTimed">时间2(大)</param>
        /// <returns>返回秒</returns>
        public static double TDiff(DateTime DateTimex, DateTime DateTimed)
        {
           return ((TimeSpan)(DateTimed - DateTimex)).TotalSeconds;
        }

程序调用:TDiff(DateTime.Now, DateTime.Now.AddHours(1))

运行结果:3600

posted @ 2011-08-09 19:24  jyshi  阅读(184)  评论(0编辑  收藏  举报
无觅相关文章插件,快速提升流量