title: Calculate salary between two Datetimes C#
body: <p>Question:
  Hi  I am wondering if threre is a way to categorize time with a simple xor or somthing like that?</p>
  
  <p>Explaination:
  I have a database table filled with DateTime fields PunchInTime And a PunchOut time and i am trying to get how many hours of a certain time-spans there are between those two fields, how many hours are there between 08:00 and 12:00 and how many between 12:30 and 16:30 and so on.</p>
  
  <p>I am a Junior programmer so maybe im overlooking somthing here but please Advise or tell me if there is somthing i need to explain further.</p>
  
  <p>Edit:</p>
  
  <p>Yes sorry im trying to acomplish this in C# and there are multiple timespans i am trying to get out of a long time between 2 datetimes but they are never spannig a longer period than 24 hours.</p>
  
  <p>I have tryed myself already with simple arithmetic but ive not managed to tackle this so it works.</p>
  
  <p>This is a part of a program i am trying to make for work hours so im trying to get this right the first time</p>