I'm developing a small scheduling application for someone who wants to be able to input a StartTime and an EndTime and allow scheduling every 10 minutes between those times. I'm trying to come up with a loop based on those times that will output a new entry in a select box (or list box) entry for every 10 minutes (I'll also check the db to see if that's already been selected, but that's irrelevant here). Does anyone have any suggestions on how to build this "every 10 minutes" time loop? I'm stumped 😕 Thanks,
Jeff
It probably depends on if you need dates as well but something like this would do. HalfaBee
$start = strtotime( "2003-10-10 06:00" ); $end = strtotime( "2003-10-10 16:00" ); while( $start < $end ) { echo date( 'H:i',$start ); $start += 60*10; }
Thanks HalfaBee.
Not a problem. Looks like you got a freebee 🙂
Please mark this thread as resolved by using the resolved link at the bottom.
HalfaBee