If the question is for a statistical PHP script. Then all the answers and basically the question is wrong.
- Last week in statistics = one until the current current week from Sunday to Monday
- This week in statistics = Current week from Sunday to Monday
( , , , PHP )
, 7 . . , 7 . , , , . , , :
$start = strtotime('2 weeks ago');
$finish = strtotime('last week');
echo date("d.m.Y", strtotime("1 week ago", strtotime('yesterday')));
. strtotime() , , , . ...
:
$today = strtotime('today 00:00:00');
$this_week_start = strtotime('-1 week monday 00:00:00');
$this_week_end = strtotime('sunday 23:59:59');
$last_week_start = strtotime('-2 week monday 00:00:00');
$last_week_end = strtotime('-1 week sunday 23:59:59');
echo date('d.m.Y H:i:s', $today) . ' - Today for example purposes<br />';
echo date('d.m.Y H:i:s', $this_week_start) . ' - ' . date('d.m.Y H:i:s', $this_week_end) . ' - Currently running week period<br />';
echo date('d.m.Y H:i:s', $last_week_start) . ' - ' . date('d.m.Y H:i:s', $last_week_end) . ' - Last week period<br />';
:
30.08.2015 00:00:00 - , ,
24.08.2015 00:00:00 - 30.08.2015 23:59:59 - 17.08.2015 00:00:00 - 23.08.2015 23:59:59 -
, 00:00:00, . 00:00:00, . , , , , .