Details
Description
I have created an entity with has a datetime column
Entity.php
/**
* @orm:Column(name="deleteAt", type="datetime")
*/
protected $deletedAt;
/**
* Get DeletedAt
* @return \DateTime
*/
public function getDeletedAt() {
return $this->deletedAt;
}
/**
* Set DeletedAt
* @param \DateTime $deletedAt
*/
public function setDeletedAt(\DateTime $deletedAt) {
$this->deletedAt = $deletedAt;
}
This should work, however I get this error when trying to set a "deleteAt" date
$this->setDeletedAt(new \DateTime());
SQLSTATE[22007]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.
This should work afaik.
Are yo using columns of type "datetime" or "datetime2" in MSSQL? The former is not supported.