首页  编辑  

计算两个时间相差的秒数

Tags: /C#/日期时间/   Date Created:

DateTime A = DateTime . Parse( "2007-02-08 12:12:13" );

DateTime B = DateTime . Parse( "2007-02-08 12:14:45" );

TimeSpan vTimeSpan = new TimeSpan (B . Ticks - A . Ticks);

Text = vTimeSpan . TotalSeconds . ToString();