title: get time intervals with time range
body: <p>I am trying to get time interval with custom start and end time variables for which i have searched and find its relevant information on this <a href="https://stackoverflow.com/questions/3207749/i-have-2-dates-in-php-how-can-i-run-a-foreach-loop-to-go-through-all-of-those-d%5D">link</a>.</p>
  <p>I have tried the following code but its giving error<code>Uncaught Error: Call to a member function date() on string</code></p>
  <pre><code>$start = date(&quot;H:i&quot;,strtotime('08:30 AM'));
  $end = date(&quot;H:i&quot;,strtotime('06:00 PM'));
  for($i = $start; $i &lt;= $end; $i-&gt;modify(' +30 MINUTE')){
      echo $i-&gt;date(&quot;H:i&quot;);
  }
  </code></pre>