Created
May 22, 2021 11:52
-
-
Save kingjmaningo/c01673a3d3fdb0aba67316de9b3fb01e to your computer and use it in GitHub Desktop.
Get 30 min interval between two time
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 | |
$time_start = 1619164800; //8:00:00 AM converted to integer | |
$time_end = 1619197200; //5:00:00 PM converted to integer | |
$interval = 1800; // 30min interval in seconds | |
$x = 1; | |
for( $item_time = $time_start; $item_time < $time_end; $item_time += $interval ) { | |
echo date('g:i a', $item_time); ?> | |
$x++; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment