title: Convert DateTime class to string
body: <p>Currently I am retrieving a date from mssql with the data type of small date time.</p>
  
  <p>The data is : <code>2013-03-12 00:00:00</code></p>
  
  <p>I want to store it in a variable and then display on a text box.</p>
  
  <p>And the format I want to display is just <code>2013-03-12</code> on the text box.</p>
  
  <p>The message I get is: </p>
  
  <blockquote>
    <p>catchable fatal error : Object of class DateTime could not be
    converted to string.</p>
  </blockquote>
  
  <p>Any idea?</p>