Skip to content

Instantly share code, notes, and snippets.

@baleethai
Forked from idhamperdameian/time_increment.php
Created July 29, 2022 02:54
Show Gist options
  • Save baleethai/859cd3f38719241919fee237d2c9f05d to your computer and use it in GitHub Desktop.
Save baleethai/859cd3f38719241919fee237d2c9f05d to your computer and use it in GitHub Desktop.
Loop for time incremented by 15 minutes
<?php
$start=strtotime('00:00');
$end=strtotime('23:30');
for ($i=$start;$i<=$end;$i = $i + 15*60)
{
echo date('H:i A',$i).'<br>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment