Here is my code:
$timezone = new \DateTimeZone('America/New_York');
$date1 = new \DateTime (date("Y:m:d H:i:s", time()), $timezone);
$date1->add(new \DateInterval ("PT24H"));
echo $date1->format('Y-m-d h:s:m');
This should add 24 hours to the current time. Problem is, each time I refresh the page, I get a different result. And I don't mean by just a couple seconds like one would expect, I mean lots of minutes. Some above the actual time some below it.
Three refreshes right now at 9:51pm give the following results: 2013-03-26 09:09:03, 2013-03-26 09:17:03, 2013-03-26 09:30:03
Why can't I get the real time? What is going on?
Thanks for the help!