Skip to content

Instantly share code, notes, and snippets.

@alexalannunes
Created October 5, 2019 15:19
Show Gist options
  • Save alexalannunes/7ecaad3c88ab326aa34dc6b9e306c8c0 to your computer and use it in GitHub Desktop.
Save alexalannunes/7ecaad3c88ab326aa34dc6b9e306c8c0 to your computer and use it in GitHub Desktop.
<?php
// intervalo de datas
// 1 day
// 30 minutes
$d1 = '2019-01-01';
$d2 = '2019-01-20';
$i = 0;
while ($d1 <= $d2) {
// echo $i. '<br>';
$d1 = date('Y-m-d H:i:s', strtotime('+ 1 hour', strtotime($d1)));
echo $d1 . '<br />';
$i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment