title: Laravel - How to get year property of date
body: <p>I have a "datetime" field in mysql. </p>
  
  <pre><code>$time = "1900-01-01 00:00:00";
  </code></pre>
  
  <p>I cant get only year.
  I tried <code>$time -&gt; year</code>, but its not good. </p>
  
  <blockquote>
    <p>(Trying to get property of non-object)
    Maybe i need to convert this string to date?</p>
  </blockquote>
  
  <p>I hope someone can help me!
  Thanks so much!</p>