hi
i need to calculate different between DateTime
i have 2 param for start date and end date
for example 2013/01/01 10:30 & 2013/01/03 17:00
and i need thet return count hourse between 07 util 15 and from 15 util 19 and from 19 util 07
please help me how to solve it
thanks
Loading

VulpesRank #55 · 29.2K reputationPosted Jan 3, 2013, 4:44 AM EST
Try this instead:
Matija Sovic2 reputationPosted Jan 2, 2013, 5:34 AM EST
http://www.c-sharpcorner.com/UploadFile/mahesh/working-with-datetime-using-C-Sharp/
You need to use TimeSpan!VulpesRank #55 · 29.2K reputationPosted Jan 2, 2013, 6:14 AM EST
Vahid Bakhtiary132 reputationPosted Jan 2, 2013, 10:50 PM EST
but it isn't my means
in a day time start from 07:00 util 07:00 next day
and i get 2 paramaters date for example 2013/01/01 10:00 & 2013/01/02 10:00
now i want calculate it that many hour is between 07:00 util 15:00 and many hour is between 15:00 util 19:00 and many hour between 19:00 util 07:00
for example for up parameter
7-15 -> 8
15-19 -> 4
19-7 -> 12
if it isn't clear tell me
Vahid Bakhtiary132 reputationPosted Jan 3, 2013, 9:40 PM EST
Vahid Bakhtiary132 reputationPosted Jan 10, 2013, 3:36 AM EST
i meet a problem calculate Holidays
namely if between 2013/01/01 10:00 and 2013/01/10 was Thursday and Friday
the hours calculate for From19To07
for example in a day is 24 hour if it was Thursday and Friday the hour don't add to
From07To15 and From15To19
and add to From19To07
From19To07+=24
please help me for solve it
thanks
VulpesRank #55 · 29.2K reputationPosted Jan 10, 2013, 5:43 AM EST
Vahid Bakhtiary132 reputationPosted Jan 10, 2013, 7:06 AM EST
it's correct
thanks