title: subtract two dates in php
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3776682/php-calculate-age">PHP calculate age</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to subtract the years and check the user's age. I keep getting 1969 for $user_birth, which I think the raw date can't be parsed.</p>
  
  <pre><code>$raw_birth = "01-19-1980";
  $user_birth = date("Y", strtotime($raw_birth));
  $today_date = date("Y", time());
  
  echo $raw_birth."&lt;br /&gt;".$today_date."&lt;br /&gt;".$user_birth."&lt;br /&gt;";
  echo $today_date-$user_birth;
  </code></pre>
  
  <p>Any ideas?</p>