(13 мар 2016, 10:04) (
0/
0)
[
0]
Ivan WF, попробуй так:
$week = strtotime('this monday', $start_of_day);
(13 мар 2016, 01:56) (
0/
0)
[
0]
Примерно так, но я не проверял
$start_of_day = strtotime(date('Y-m-d'));
$yesterday = strtotime('-1 day', $start_of_day);
$week = strtotime('the week monday');
$month = strtotime('first day of this month');
// За сегодня
$query = 'SELECT * FROM views WHERE time >= ' . $start_of_day;
// За вчера
$query = 'SELECT * FROM views WHERE time >= ' . $yesterday . ' AND time < ' . $start_of_day;
// За неделю
$query = 'SELECT * FROM views WHERE time >= ' . $week;