Skip to content

Instantly share code, notes, and snippets.

@GiovanniK
Created January 12, 2016 08:30
Show Gist options
  • Save GiovanniK/426de8e1f307e7335ba8 to your computer and use it in GitHub Desktop.
Save GiovanniK/426de8e1f307e7335ba8 to your computer and use it in GitHub Desktop.
24 uur, 15 min interval - PHP
<?php
for($i = 0; $i <= 23; $i++) {
// If hour is lower than 10, append a 0
if($i < 10) {
$append = 0;
} else {
$append = '';
}
// Echo hour + minute
$minutes = 0;
for($i2 = 1; $i2 <= 4; $i2++) {
$minutes = ($i2 * 15) - 15;
$minutes2 = ($minutes > 0) ? $minutes : $minutes . '0';
echo $append . $i . ':' . $minutes2 . '<br>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment