title: Split the time difference to individual hours
body: <p>I have a <code>data.table</code> which contains date and timestamps for start and end date. I know I can calculate the time difference by using the <code>difftime</code> function. But I want to calculate the time difference and split it into individual hours in each row along with the copy of the rest of the data. for example:</p>
  
  <pre class="lang-r prettyprint-override"><code>    Start_time                         End_time 
  
         1: 2017-01-01 00:15:00 2017-01-01 00:23:00   
         2: 2017-01-01 00:24:00 2017-02-01 00:10:00   
         3: 2017-01-01 23:38:00 2017-02-01 00:45:00  
         4: 2017-01-01 14:38:00 2017-01-01 07:43:00    
         5: 2017-01-01 06:38:00 2017-01-01 00:43:00  
  
  </code></pre>
  
  <p>i did the following to extract the start hour and end hour</p>
  
  <pre><code>    Start_time                         End_time             start_hour    end hour
  
     1: 2017-01-01 00:15:00 2017-01-01 00:23:00         0            0
     2: 2017-01-01 00:24:00 2017-02-01 00:10:00         0            0
     3: 2017-01-01 23:38:00 2017-02-01 00:45:00         23           0
     4: 2017-01-01 14:38:00 2017-01-01 07:43:00         14           7
     5: 2017-01-01 06:38:00 2017-01-01 00:43:00          6           0
  </code></pre>
  
  <pre><code>now, i have to find all the temperatures between start_hour and end_hour inclusive and populate my table 
  i have a weather report which is collected hourly with corresponding temperature, 
   **DateTime**               **Temperature**      hour
  1  2017-01-01 06:00:00          16                6
  2  2017-01-01 05:00:00          16                5
  3  2017-01-01 04:00:00          16                4
  4  2017-01-01 08:00:00           9                8
  5  2017-01-01 03:00:00           5                3           
  6  2017-01-01 00:00:00           8                0
  7  2017-01-01 07:00:00           5                7
  
  i have to get all the temperatures between the starttime and end time (inclusive)
  
  ie. if a ride is for 4 hours on a day, 2017-01-01 00:05:00 till 2017-01-01 
  04:00:00 i need 4 rows with 4 different temperatures 00:00:00 , 01:00:00, 02:00:00, 03:00:00,04:00:00 . 
  date should also be considered here ex: 2017-01-01 23:45:00 till 2017-02-01 14:45:00 ,
   i need 15 rows for corresponding temperature.
   i am struggling with issue and couldnot find a solution,kindly help
  </code></pre>