I have three inputs
- Start time
- End time
- intermediate time.
Example
start time - 01:00 end time - 01:30 intervel-time - 10 min
I need a conclusion, for example, 01:00, 01:10, 01:20, 01:30
I tried this code below, its not working.
<?php $startTime=strtotime("2012-07-13 01:00:00"); $endTime=strtotime("2012-07-13 01:30:00"); $time=$startTime; while ($time < $endTime) { echo date('H:i:s', $time) . " - "; $time = strtotime('+10 minutes', $time); echo date('H:i:s', $time) . "<br>"; } ?>
When I try with a start and end time interval of 60 minutes, the above code works.
I am new to PHP.
Someone please help me.
user3040205
source share