title: ORA-01861: literal does not match format string while using DateTime
body: <p>I try to persist my entity into my database and face <code>the ORA-01861: literal does not match format string</code> error. I know it is most of the times an error between dates and strings'conversions which leads to this message. It might be the case for me too, but I can't figure out why. Here is the sql statement (from the profiler) : </p>
  
  <pre><code>INSERT INTO Person (no_person, first_name, usual_name, last_name,
  birth_date, comments, c_user_creation, date_creation, c_user_modification, 
  date_modification, email, id_rh, cod_civ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
  ?, ? ) Parameters: { 1: '173704', 2: Test, 3: 'null', 4: Test, 5: Object(DateTime), 6: 'null', 
  7: Web, 8: Object(DateTime), 9: 'null', 10: 'null', 11: zefzf@dgeghte.fr, 12: 'null', 13: '1'}
  Time: 0.00 ms 
  </code></pre>
  
  <p>The Person entity :</p>
  
  <pre><code>&lt;?php
  
  namespace my\myBundle\Entity;
  
   use Doctrine\ORM\Mapping as ORM;
  use Symfony\Component\HttpFoundation\File\UploadedFile;
  
  /**
   * my\myBundle\Entity\Person
   *
   * @ORM\Table(name="Person")
   * @ORM\Entity(repositoryClass="my\myBundle\Entity\PersonRepository")
   */
  class Person
  {
  /**
   *
   * @ORM\Id
   * @ORM\GeneratedValue(strategy="SEQUENCE")
   * @ORM\Column(name="no_Person", type="integer")
   * @ORM\SequenceGenerator(sequenceName="SEQ_NO_Person")
   */
  public $noPerson;
  
  /**
   *
   * @ORM\ManyToOne(targetEntity="civility")
   * @ORM\JoinColumn(name="cod_civ", referencedColumnName="cod_civ")
   */
  private $civility;
  
  /**
   * @var string $firstName
   *
   * @ORM\Column(name="first_name", type="string", length=30)
   */
  private $firstName;
  
  /**
   * @var string $usualName
   *
   * @ORM\Column(name="usual_name", type="string", length=30)
   */
  private $usualName;
  
  /**
   * @var string $lastName
   *
   * @ORM\Column(name="last_name", type="string", length=20)
   */
  private $lastName;
  
  /**
   * @var date $birthDate
   *
   * @ORM\Column(name="birth_date", type="date")
   */
  private $birthDate;
  
  /**
   * @var string $comment
   *
   * @ORM\Column(name="comment", type="string", length=300)
   */
  private $comment;
  
  /**
   * @var string $cUserCreation
   *
   * @ORM\Column(name="c_user_creation", type="string", length=30)
   */
  private $cUserCreation;
  
  /**
   * @var date $dCreation
   *
   * @ORM\Column(name="date_creation", type="date")
   */    
  private $dCreation;
  
  /**
   * @var string $cUserModification
   *
   * @ORM\Column(name="c_user_modification", type="string", length=30)
   */
  private $cUserModification;
  
  /**
   * @var date $dModification
   *
   * @ORM\Column(name="date_modification", type="date")
   */    
  private $dModification;
  
  /**
   * @var string $email
   *
   * @ORM\Column(name="email", type="string", length=100)
   */
  private $email;
  
  /**
   * @var integer $idRh
   *
   * @ORM\Column(name="id_rh", type="integer")
   */
  private $idRh;
  
  /**
   * @var \Doctrine\Common\Collections\ArrayCollection $accCip
   *
   * @ORM\OneToMany(targetEntity="my\myBundle\Entity\AccCip",mappedBy="Person")
   */
  
  private $accCip;
  
  
  /**
   * @var \Doctrine\Common\Collections\ArrayCollection $cartes
   *
   * @ORM\OneToMany(targetEntity="my\myBundle\Entity\Carte",mappedBy="Person")
   */
  
  private $cartes;
  
  /**
   * @var \Doctrine\Common\Collections\ArrayCollection $panier
   *
   * @ORM\OneToMany(targetEntity="my\myBundle\Entity\Panier",mappedBy="Person")
   */
  
  private $panier;
  
  /**
   * @var \Doctrine\Common\Collections\ArrayCollection $transactions
   *
   * @ORM\OneToMany(targetEntity="my\myBundle\Entity\TransactionPaybox",mappedBy="Person")
   */
  
  private $transactions;
  
  /**
   * @var my\myBundle\Entity\Adresse $adresses
   *
   * @ORM\OneToMany(targetEntity="my\myBundle\Entity\Adresse",mappedBy="Person",cascade={"persist"})
   */
  private $adresses;
  
  public function __construct()
  {
      $this-&gt;cUserCreation = "Web";
      $this-&gt;dCreation = new \DateTime();
      $this-&gt;birthDate = new \DateTime();
      $this-&gt;cartes = new \Doctrine\Common\Collections\ArrayCollection();
      $this-&gt;accCip = new \Doctrine\Common\Collections\ArrayCollection();
      $this-&gt;panier = new \Doctrine\Common\Collections\ArrayCollection();
      $this-&gt;transactions = new \Doctrine\Common\Collections\ArrayCollection();
      $this-&gt;insActSpos = new \Doctrine\Common\Collections\ArrayCollection();
      $this-&gt;adresses = new \Doctrine\Common\Collections\ArrayCollection();
  }
  
  /**
   * Get noPerson
   *
   * @return integer 
   */
  public function getNoPerson()
  {
      return $this-&gt;noPerson;
  }
  
  /**
   * Set firstName
   *
   * @param string $firstName
   */
  public function setfirstName($firstName)
  {
      $this-&gt;firstName = $firstName;
  }
  
  /**
   * Get firstName
   *
   * @return string 
   */
  public function getfirstName()
  {
      return $this-&gt;firstName;
  }
  
  /**
   * Set usualName
   *
   * @param string $usualName
   */
  public function setusualName($usualName)
  {
      $this-&gt;usualName = $usualName;
  }
  
  /**
   * Get usualName
   *
   * @return string 
   */
  public function getusualName()
  {
      return $this-&gt;usualName;
  }
  
  /**
   * Set lastName
   *
   * @param string $lastName
   */
  public function setlastName($lastName)
  {
      $this-&gt;lastName = $lastName;
  }
  
  /**
   * Get lastName
   *
   * @return string 
   */
  public function getlastName()
  {
      return $this-&gt;lastName;
  }
  
  /**
   * Set birthDate
   *
   * @param string $birthDate
   */
  public function setbirthDate(\DateTime $birthDate)
  {
      $this-&gt;birthDate = clone $birthDate;
  }
  
  /**
   * Get birthDate
   *
   * @return string 
   */
  public function getbirthDate()
  {
      return $this-&gt;birthDate;
  }
  
  /**
   * Set comment
   *
   * @param string $comment
   */
  public function setcomment($comment)
  {
      $this-&gt;comment = $comment;
  }
  
  /**
   * Get comment
   *
   * @return string 
   */
  public function getcomment()
  {
      return $this-&gt;comment;
  }
  
  /**
   * Set cUserCreation
   *
   * @param string $cUserCreation
   */
  public function setCUserCreation($cUserCreation)
  {
      $this-&gt;cUserCreation = $cUserCreation;
  }
  
  /**
   * Get cUserCreation
   *
   * @return string 
   */
  public function getCUserCreation()
  {
      return $this-&gt;cUserCreation;
  }
  
  /**
   * Set dCreation
   *
   * @param string $dCreation
   */
  public function setDCreation(\DateTime $dCreation)
  {
      $this-&gt;dCreation = clone $dCreation;
  }
  
  /**
   * Get dCreation
   *
   * @return string 
   */
  public function getDCreation()
  {
      return $this-&gt;dCreation;
  }
  
  /**
   * Set cUserModification
   *
   * @param string $cUserModification
   */
  public function setCUserModification($cUserModification)
  {
      $this-&gt;cUserModification = $cUserModification;
  }
  
  /**
   * Get cUserModification
   *
   * @return string 
   */
  public function getCUserModification()
  {
      return $this-&gt;cUserModification;
  }
  
  /**
   * Set dModification
   *
   * @param string $dModification
   */
  public function setDModification(\DateTime $dModification)
  {
      $this-&gt;dModification = clone $dModification;
  }
  
  /**
   * Get dModification
   *
   * @return string 
   */
  public function getDModification()
  {
      return $this-&gt;dModification;
  }
  
  /**
   * Set email
   *
   * @param string $email
   */
  public function setEmail($email)
  {
      $this-&gt;email = $email;
  }
  
  /**
   * Get email
   *
   * @return string 
   */
  public function getEmail()
  {
      return $this-&gt;email;
  }
  
  /**
   * Set idRh
   *
   * @param integer $idRh
   */
  public function setIdRh($idRh)
  {
      $this-&gt;idRh = $idRh;
  }
  
  /**
   * Get idRh
   *
   * @return integer 
   */
  public function getIdRh()
  {
      return $this-&gt;idRh;
  }
  
  /**
   * Set civility
   *
   * @param my\myBundle\Entity\civility $civility
   */
  public function setcivility(\my\myBundle\Entity\civility $civility)
  {
      $this-&gt;civility = $civility;
  }
  
  /**
   * Get civility
   *
   * @return my\myBundle\Entity\civility 
   */
  public function getcivility()
  {
      return $this-&gt;civility;
  }
  
  /**
   * Get accCip
   *
   * @return \Doctrine\Common\Collections\ArrayCollection;
   *
   */
  public function getAccCip(){
      return $this-&gt;accCip;
  }
  
  /**
   * Add accCip
   *
   * @param AccCip $accCip;
   * 
   * @return Person
   *
   */
  
    public function addAccCip(AccCip $accCip)
    {
      $this-&gt;accCip[] = $accCip;
      $accCip-&gt;setPerson($this);
      return $this;
    }
  
    /**
     * Remove accCip
     *
     * @param AccCip $accCip;
     *
     *
     */
  
    public function removeAccCip(AccCip $accCip)
    {
      $this-&gt;accCip-&gt;removeElement($accCip);
    }
  
    /**
     * Get cartes
     *
     * @return \Doctrine\Common\Collections\ArrayCollection
     *
     */
    public function getCartes(){
      return $this-&gt;cartes;
    }
  
    /**
     * Add carte
     *
     * @param Carte $carte;
     *
     * @return Person
     *
     */
  
    public function addCarte(Carte $carte)
    {
      $this-&gt;cartes[] = $carte;
      $carte-&gt;setPerson($this);
      return $this;
    }
  
    /**
     * Remove carte
     *
     * @param Carte $carte;
     *
     *
     */
  
    public function removeCarte(Carte $carte)
    {
      $this-&gt;cartes-&gt;removeElement($carte);
    }
  
    /**
     * Has carte
     * 
     * @return boolean
     * 
     */
  
    public function hasCarte()
    {
      return $this-&gt;cartes-&gt;count()!=0;
    }
  
    /**
     * Get panier
     *
     * @return \Doctrine\Common\Collections\ArrayCollection
     *
     */
    public function getPanier(){
      return $this-&gt;panier;
    }
  
    /**
     * Add panier
     *
     * @param Panier $panier;
     *
     * @return Person
     *
     */
  
    public function addPanier(Panier $panier)
    {
      $this-&gt;panier[] = $panier;
      $panier-&gt;setPerson($this);
      return $this;
    }
  
    /**
     * Remove panier
     *
     * @param Panier $panier;
     *
     *
     */
  
    public function removePanier(Panier $panier)
    {
      $this-&gt;panier-&gt;removeElement($panier);
    }
  
    /**
     * Get Somme Panier
     * 
     * @return float
     * 
     */
  
    public function getSommePanier()
    {
      $somme=0;
      foreach ($this-&gt;panier as $item){
          $somme+=$item-&gt;getMontant();
      }
      return $somme;
    }
  
    /**
     * Get transactions
     *
     * @return \Doctrine\Common\Collections\ArrayCollection
     *
     */
    public function getTransactions(){
      return $this-&gt;transactions;
    }
  
    /**
     * Add transaction
     *
     * @param TransactionPaybox $transaction;
     *
     * @return Person
     *
     */
  
    public function addTransaction(TransactionPaybox $transaction)
    {
      $this-&gt;transactions[] = $transaction;
      $transaction-&gt;setPerson($this);
      return $this;
    }
  
    /**
     * Remove transaction
     *
     * @param TransactionPaybox $transaction;
     *
     *
     */
  
    public function removeTransaction(TransactionPaybox $transaction)
    {
      $this-&gt;transactions-&gt;removeElement($transaction);
    }
  
    /**
     * Get adresses
     *
     * @return \Doctrine\Common\Collections\ArrayCollection
     *
     */
    public function getAdresses(){
      return $this-&gt;adresses;
    }
  
  
    /**
     * Add Adresse
     *
     * @param my\myBundle\Entity\Adresse $adresse;
     *
     * @return Person
     *
     */
  
    public function addAdresse(Adresse $adresse)
    {
      $this-&gt;adresses[] = $adresse;
      $adresse-&gt;setPerson($this);
      return $this;
    }
  
    /**
     * Remove adresses
     *
     * @param my\myBundle\Entity\Adresse $adresse;
     *
     *
     */
  
    public function removeAdresse(Adresse $adresse)
    {
      $this-&gt;adresses-&gt;removeElement($adresse);
    }
  </code></pre>
  
  <p>}</p>
  
  <p>SQL : </p>
  
  <pre><code>CREATE TABLE "MYDB"."PERSON" 
  (   "NO_PERSON" NUMBER(8,0), 
  "COD_CIV" VARCHAR2(1 BYTE), 
  "FIRST_NAME" VARCHAR2(30 BYTE), 
  "USUAL_NAME" VARCHAR2(30 BYTE), 
  "LAST_NAME" VARCHAR2(20 BYTE), 
  "BIRTH_DATE" DATE, 
  "COMMENT" VARCHAR2(300 BYTE), 
  "C_USER_CREATION" VARCHAR2(30 BYTE), 
  "DATE_CREATION" DATE, 
  "C_USER_MODIFICATION" VARCHAR2(30 BYTE), 
  "DATE_MODIFICATION" DATE, 
  "EMAIL" VARCHAR2(100 BYTE), 
  "ID_RH" NUMBER(8,0), 
  )
  </code></pre>
  
  <p>EDIT : some more informations. I've changed the dates to actual type dates recently (since they were "string" in previous version (I wasn't the developer at this time). When doctrine try to create entity, it throws this exception : </p>
  
  <pre><code>Could not convert database value "08/07/92" to Doctrine Type date. Expected format: Y-m-d 00:00:00 
  </code></pre>
  
  <p>The dates in database are actually "date" sql's type.</p>