[ create a new paste ] login | about

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

PHP, pasted on Apr 12:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

// init values
$startDate = date('n/j/Y'); // Today
$endDate = date('n/j/Y', strtotime('+2 months')); // 2 months from today


$startDate = strtotime('next Tuesday', strtotime($startDate) );
$endDate= strtotime($endDate);


while ($startDate < $endDate) {
    echo date('n/j/Y', $startDate ). "\n";
    $startDate = strtotime('next Tuesday', $startDate );
}

?>


Output:
1
2
3
4
5
6
7
8
4/17/2012
4/24/2012
5/1/2012
5/8/2012
5/15/2012
5/22/2012
5/29/2012
6/5/2012


Create a new paste based on this one


Comments: