MySQL Forums
Forum List  »  General

loop thru time increment by 5 minutes
Posted by: Asad Mahmood
Date: December 22, 2017 12:06AM

Hi friends,
I want to loop time in mysql increment by 5 minutes like following example in php but I want do it in mysql thank you

$startTime='09:00:00';
$endTime='11:00:00';
$Times=array();
$interval=15;

while(strtotime($startTime) < strtotime($endTime))
{
$Times[]=$startTime;
$startTime=strtotime("+".$interval." minutes",strtotime($startTime));
$startTime=date('h:i:s',$startTime);
}

Options: ReplyQuote


Subject
Written By
Posted
loop thru time increment by 5 minutes
December 22, 2017 12:06AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.