title: Symfony2 datetime best way to store timestamps?
body: <p>I don't know which is the best way to store a timestamp in the database. I want to store the entire date with hours minutes and seconds but it only stores the date ( for instance 2012-07-14 ) and i want to store 2012-07-14 HH:MM:SS. I am using the dateTime object. Here is the code:</p>
  
  <p><strong>In the controller:</strong></p>
  
  <pre><code>$user-&gt;setCreated(new \DateTime());
  </code></pre>
  
  <p><strong>In the entity:</strong></p>
  
  <pre><code>/**
   * @var date $created
   *
   * @ORM\Column(name="created", type="date")
   */
  private $created;
  </code></pre>
  
  <p>Is it better to store the date and the the time separately in the database ? or better to store all together like YYYY-MM-DD HH:MM:SS ? I will have then to compare dates and calculate the remaining times, so that is important in order to simplify the operations later. So what do you think ? can somebody help me?</p>