I am using Doctrine 2.2 with php 5.3 on apache server.
So far I have encountered the following problem: When I try to update the datetime column, I get: SQLSTATE [22007]: [Microsoft] [SQL Server Native Client 10.0] [SQL Server] Conversion failed when converting date and / or time from string characters.
I even went so far as to get into the column, and then use it, adding only 1 day to it to set a new date ...... the same result.
When I instead change both the column in the database and in essence from date to time, it functions as intended.
My main problem is that there are several fields in which I NEED to use the datetime column.
Here is my code:
(the date of birth was a column that I changed to a date .... and is one of the few columns where this is possible for me):
$help=$object->getBirthDate();
$help->setTimestamp(mktime($time[0],$time[1],$time[2],$date[2],$date[1],$date[0]));
$help->format(\DateTime::ISO8601);
$object->setBirthDate($help);
Does anyone know a workaround here?
source
share