title: Calculate time difference between 2 date()'s
body: <p>I've got an input field where I type in a deadline in words. For example, "5 minutes", "2 days", "6 weeks", "8 months". What I want for the program to do is to calculate how long it will take when that deadline ends. And also if that deadline is almost ending, for example if 80% of the given time has passed.</p>
  
  <p>I was thinking something like that php splits the given time in seconds, and then checks how many minutes and hours or days fit in those seconds and then puts that in dateTime. Like current date + input = futureDate.</p>
  
  <p>I know I probably shouldn't use percentages, it's just an example.</p>
  
  <pre><code>&lt;input type="text" name="getFutureTime"&gt;
  
  &lt;?php
      $futureTime = $_POST['getFutureTime'];
      $dateNow = date('d-m-Y H:i:s');
  
      if($futureTime &gt; $dateNow){
          //Calculate
          echo "Deadline has passed";
      }else if (($futureTime / 100 * 80) &lt; $dateNow){
          //Calculate
          echo "Deadline is almost passed";
      }
  ?&gt;
  </code></pre>