Get the labor day : mktime « Date « PHP

Get the labor day

print '<table>';
print '<tr><th>Year</th><th>Labor Day</th></tr>';

for ($year = 2004; $year <= 2020; $year++) {
    $stamp = mktime(12,0,0,9,1,$year);
    $stamp = strtotime('monday', $stamp);

    print "<tr><td>$year</td><td>";
    print date('F j', $stamp);
    print "</td></tr>\n";

print '</table>';

Related examples in the same category

1.Calculating the difference between two dates
2.Checking credit card expiration
3.Creating a Timestamp with mktime()
4.Use mktime to create a time
5.Using mktime() and date() mktime ( [int hour [, int minute [, int second [, int month[, int day [, int year [, int is_dst]]]]]]] )
7.mktime() produces a GMT timestamp.
9.Making an epoch timestamp