<?php
$F = strftime("%F") ? "%F" : "%Y-%m-%d";
foreach (array("Sat 2016-07-30", "Sun 2016-07-31", "Mon 2016-08-01", "Tue 2016-08-02") as $ref) {
$ref = strtotime($ref);
echo strftime("Relative to %a $F\n", $ref);
foreach (array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") as $day) {
echo strftime("{$day} this week = %a $F\t", strtotime("{$day} this week", $ref));
echo strftime("this week {$day} = %a $F\n", strtotime("this week {$day}", $ref));
}
echo "\n";
}
preferences:
54.43 ms | 402 KiB | 5 Q