[ create a new paste ] login | about

Link: http://codepad.org/JwBDOQQE    [ raw code | output | fork ]

PHP, pasted on Aug 18:
1
2
3
4
5
6
7
8
<?php
$start = new DateTime("2011-08-18 18:00:00");
$end = new DateTime("2011-08-18 22:30:00");
$current = clone $start;
while ($current <= $end) {
    echo $current->format("g:ia"), "\n";
    $current->modify("+15 minutes");
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
6:00pm
6:15pm
6:30pm
6:45pm
7:00pm
7:15pm
7:30pm
7:45pm
8:00pm
8:15pm
8:30pm
8:45pm
9:00pm
9:15pm
9:30pm
9:45pm
10:00pm
10:15pm
10:30pm


Create a new paste based on this one


Comments: