I've got a Problem with DateTime in PHP. In my Testcase I have 10.000 Rows that are pulled from a MySQL InnoDB Database. This works fine, as my local development is running on a SSD and it takes about 10 Seconds to pull all Rows. As ORM in PHP I'm using Propel. (because I like the Getter and Setter, anyway). The Problem is that after a few rows, approx at the 50 row, the calculation gets more and more off. I'm trying to Display a "due time".
The Code looks like this and it's working, until the 50 row.
$dateTime = $message->getReceivedat ();
$dateinterval = new DateInterval("PT15M");
$dateTime->add ($dateinterval);
echo $dateTime->format ('d-m-Y H:i:s');
after the 50 row, it gets more and more off. At the 10.000 i got + 1 Day and 4 hours. So maybe it's a buffer Error from InnoDB, or Propel to not give me the right Dates.
Here are the values i get.
|ReceivedAt | DueTo |
24-07-2015 16:11:24 | 24-07-2015 16:26:24 The first row
24-07-2015 16:11:46 | 24-07-2015 16:28:46 The second one (is already of by 2 minutes)
29-07-2015 15:11:11 | 29-07-2015 16:14:11 The last row is this one.
I'm developing locally on a Windows 8.1 x64, XAMPP (newest Version), Propel (newest Version), 24GB DDR3 RAM, and Intel I7-4790, and the Database is on a 256gb Samsung SSD.
i got it, it was a formatting error with the "echo" in php. I did use H:II:s instead of H:i:s. But it's interesting that the echo showed the wrong time and was off completely.