so i'm stuck on something annoying! This:
for($x=59;$x >=0 ;$x--)
{
$days_ago1 = date('00,00,00,m,d,Y', time() - $x * SECONDS_PER_DAY);
//debuging echo "**.".$days_ago1.".**";
$days_ago1=mktime($days_ago1);
$days_ago2 = mktime(date('23,59,59,m,d,Y', time() - $x * SECONDS_PER_DAY));
echo $days_ago1."<br>";
echo $days_ago2."<br>";
}
Returns this: Notice how the epoch times don't change. i've verified the dates do decrease, but the mktime results dont.
**.00,00,00,09,01,2015.**1446178911 1446261711
**.00,00,00,09,02,2015.**1446178911 1446261711
**.00,00,00,09,03,2015.**1446178911 1446261711
**.00,00,00,09,04,2015.**1446178911 1446261711
**.00,00,00,09,05,2015.**1446178911 1446261711
**.00,00,00,09,06,2015.**1446178911 1446261711
**.00,00,00,09,07,2015.**1446178911 1446261711
**.00,00,00,09,08,2015.**1446178911 1446261711
i've also tried this:
for($x=59;$x >=0 ;$x--)
{
echo date('00,00,00,m,d,Y', strtotime("-$x days"))."<br>";
//so $date_begin is going to by in
$days_ago1 = mktime(date('00,00,00,m,d,Y', strtotime("-$x days")));
echo $days_ago1."<br>";
$days_ago2 = date('23,59,59,m,d,Y');
$days_ago2=(mktime($days_ago2)-($x * SECONDS_PER_DAY));
echo "Date 1: ".date("Y-m-d\TH:i:s\Z", $days_ago1)."<br>";
echo "Date 2: ".date("Y-m-d\TH:i:s\Z", $days_ago2)."<br>";
//get 'x' number of days ago usage rate
$SQLpid = "SELECT sum(minsused) FROM transactions WHERE subid = '$company' AND (timestamp AND planid='$planid' AND direction='outbound'";
}
/*
and it still returns this:
00,00,00,09,04,2015 1446442355 Date 1: 2015-11-02T00:32:35Z Date 2: 2015-09-05T00:32:35Z 00,00,00,09,05,2015 1446442355 Date 1: 2015-11-02T00:32:35Z Date 2: 2015-09-06T00:32:35Z 00,00,00,09,06,2015 1446442355 Date 1: 2015-11-02T00:32:35Z Date 2: 2015-09-07T00:32:35Z 00,00,00,09,07,2015 1446442355 Date 1: 2015-11-02T00:32:35Z Date 2: 2015-09-08T00:32:35Z 00,00,00,09,08,2015 1446442355 Date 1: 2015-11-02T00:32:35Z Date 2: 2015-09-09T00:32:35Z 00,00,00,09,09,2015 1446442355 Date 1: 2015-11-02T00:32:35Z Date 2: 2015-09-10T00:32:35Z 00,00,00,09,10,2015 1446442355 Date 1: 2015-11-02T00:32:35Z Date 2: 2015-09-11T00:32:35Z 00,00,00,09,11,2015 1446442355 Date 1: 2015-11-02T00:32:35Z Date 2: 2015-09-12T00:32:35Z 00,00,00,09,12,2015 1446442355 Date 1: 2015-11-02T00:32:35Z Date 2: 2015-09-13T00:32:35Z