title: Checking if dates are between a range
body: <p>I have a column with start dates and end dates (plus times).</p>
  
  <p>Then I'd have 31 separate columns, one for each day of the month that contains a 1 or 0 if the start and end dates encompass the day in the column.</p>
  
  <p>I have converted the date values into dates using <code>strptime</code>. I know how to use <code>difftime</code>.</p>
  
  <p>The bit i'm stuck on is actually doing the comparison and checking whether the start date is before or after the date of the column. e.g. i want to know if the start and end date includes the 1st of Jan, then the 2nd of Jan......if the start date is the 5th, i should return 0 for those 2 columns but I don't know how to make the comparison.</p>
  
  <p>Added some sample data</p>
  
  <ul>
  <li>Col 1 Start Date: 01/01/2015  17:00:00</li>
  <li>Col 2 End Date: 14/01/2015  10:55:00</li>
  <li>Col 3 Jan-01: 1</li>
  <li>Col 3 Jan-02: 1</li>
  </ul>
  
  <p>So in columns 3, i'd want to check if start and end date encompasses the 1st of Jan.</p>
  
  <p>The start date can be at some point on the 1st of Jan, e.g. 4pm. If this is the case, i'd like column 3 to return 0.5 days.</p>
  
  <ul>
  <li>Col 1 Start Date: 01/01/2015  00:00:00</li>
  <li>Col 2 End Date: 01/01/2015  16:00:00</li>
  <li>Col 3 Jan-01: 0.6667</li>
  <li>Col 3 Jan-02: 0</li>
  </ul>
  
  <p>Hopefully this is now more clear. I think the complexity of having time and not just returning a Boolean result means this is not a duplicate question.</p>