title: java split datetime period and return array
body: <p>I'm building a web application in java using simple jsp, I'd like to know if there is a way to get an array of <code>datetime</code> values between <code>datetime_start</code> and datetime_stop per <code>hours/day/minutes/etc</code>. 
  I'm searching for something like that:</p>
  
  <pre><code>Array getvalues(datetime_start, datetime_stop, "day/hours/min")
  </code></pre>
  
  <p>for example:</p>
  
  <pre><code>getvalues("2018-07-02 20:25:08.208812","2018-07-03 20:25:08.208812","hours");
  </code></pre>
  
  <p>it returns: </p>
  
  <pre><code>2018-07-02 20:25:08.208812 &lt;br&gt;
  2018-07-02 21:25:08.208812&lt;br&gt;
  2018-07-02 22:25:08.208812&lt;br&gt;
  2018-07-02 23:25:08.208812&lt;br&gt;
  2018-07-02 24:25:08.208812&lt;br&gt;
  2018-07-02 01:25:08.208812&lt;br&gt;
  2018-07-02 02:25:08.208812&lt;br&gt;
  2018-07-02 03:25:08.208812&lt;br&gt;
  2018-07-02 04:25:08.208812&lt;br&gt;
  2018-07-02 05:25:08.208812&lt;br&gt;
  2018-07-02 06:25:08.208812&lt;br&gt;
  2018-07-02 07:25:08.208812&lt;br&gt;
  2018-07-02 08:25:08.208812&lt;br&gt;
  2018-07-02 09:25:08.208812&lt;br&gt;
  2018-07-02 10:25:08.208812&lt;br&gt;
  2018-07-02 11:25:08.208812&lt;br&gt;
  2018-07-02 12:25:08.208812&lt;br&gt;
  2018-07-02 13:25:08.208812&lt;br&gt;
  2018-07-02 14:25:08.208812&lt;br&gt;
  2018-07-02 15:25:08.208812&lt;br&gt;
  2018-07-02 16:25:08.208812&lt;br&gt;
  2018-07-02 17:25:08.208812&lt;br&gt;
  2018-07-02 18:25:08.208812&lt;br&gt;
  2018-07-02 19:25:08.208812&lt;br&gt;
  2018-07-02 20:25:08.208812&lt;br&gt;
  </code></pre>
  
  <p>can enyone help me?</p>