Hello,
I have working on asp.net with c#, In I want to create one small module which related attendance and overtime.
Means, One man enter with that datetime and also leave with that datetime,
like Enter Date: 15/12/2014 21:00
Leave Date: 16/12/2014 11:00
so, I want to know, he has worked how many hours ?, with above datetime.
By manually he has worked around 14 Hours. but i want calculate with C#.
Thanks & Regards.
He has worked how many hours ? c#, datetme, timespan
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Guest UserRank #816 · 2.8K reputationPosted Dec 14, 2014, 11:51 PM EST
DateTime end = new DateTime(2014, 12, 16, 11, 0, 0);
TimeSpan span = end - start;