I am trying to output this in PHP as a UNIX timestamp instead:
05-30-2014 0:00:00
05-30-2014 23:59:59
05-29-2014 0:00:00
05-29-2014 23:59:59
05-28-2014 0:00:00
05-28-2014 23:59:59
05-27-2014 0:00:00
05-27-2014 23:59:59
05-26-2014 0:00:00
05-26-2014 23:59:59
05-25-2014 0:00:00
05-25-2014 23:59:59
05-24-2014 0:00:00
05-24-2014 23:59:59
This should be dynamic, and always show the previous seven days.
So, I am trying to get the start, and end, of each of the last seven days as a timestamp.
I was able to get the dates to output, but when including times and converting to timestamps I think it is getting messed up.
EDIT
I have this so far, which gets me the correct starting date and times, but this needs to be converted to a timestamp.
$timestamp = time()- 3600 * 24;
for ($i = 0 ; $i < 7 ; $i++) {
echo date('Y-m-d 00:00:00', $timestamp) .'<br />';
echo date('Y-m-d 23:59:59', $timestamp) .'<br />';
$timestamp -= 24 * 3600;
}
When I try changing it to a timestamp, and then use an online converter to reverse the timestamp it's always off by 5 hours. For example, I took the timestamp for midnight of a given date, and checked it in the online converter to see if it was correct, but it was saying 5am instead of midnight.