Created
July 7, 2023 02:54
-
-
Save shelane/731d4d129e632f89c673b8bc4257f956 to your computer and use it in GitHub Desktop.
generate times by half hour increments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This should replace the DisplayPracticeTimes function. | |
$startTime = strtotime('08:00'); | |
$endTime = strtotime('21:00'); | |
$increment = 30 * 60; // 30 minutes in seconds | |
$times = array(); | |
$current = $startTime; | |
while ($current <= $endTime) { | |
$time = date('H:i', $current); | |
$times[] = $time; | |
$current += $increment; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment