PHP gets today's start timestamp and end timestamp
$beginToday=mktime(0,0,0,date(' m '),date (' d '),date(' Y ')); $endToday=mktime(0,0,0,date(' m '),date(' d ') +1,date(' Y '))-1;
PHP gets yesterday start timestamp and end timestamp
$beginYesterday=mktime(0,0,0,date(' m '),date(' d ')-1,date(' Y ')) ; $endYesterday=mktime(0,0,0,date(' m '),date (' d '),date(' Y '))-1;
PHP gets last week start timestamp and end timestamp
$beginLastweek=mktime(0,0,0,date(' m '),date(' d ')-date(' W ') +1-7, Date (' Y ')); $endLastweek=mktime(23,59,59,date(' m '),date(' d ')-date(' W ') + 7-7,date(' Y '));
PHP gets this month start timestamp and end timestamp
$beginThismonth=mktime(0,0,0,date(' m '), 1,date(' Y ')); $endThismonth=mktime(23,59,59,date(' m '),date (' t '),date(' Y '));
The rest and so on
PHP gets a timestamp for a certain period of time