开发者

Calculate time between two dates

i have a datepicker. i have found the difference between two dates using

DateTime  startdate = frmdate_starttime.Date;
DateTime  enddate = frmdate_endtime.Date;
TimeSpan ts1 = enddate.Subtract(startdate开发者_如何学Python);

now i want to multiply the timespan value with 10 hrs . but 10 hrs is in datatype int. how can i multiply the timespan value with int val.


If you multiply a time with a time, you would get a very strange unit like hours squared... I assume that you want to multiply the number of days in the time span by ten hours:

int hours = ts1.Days * 24 * 10
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜