title: Converting PHP DateInterval to period specification
body: <p>Using PHP, I want to be able to go from a <code>strtotime</code> <a href="https://secure.php.net/manual/en/datetime.formats.relative.php" rel="nofollow noreferrer">relative time</a> to a datetime interval that can be used for an iCalendar duration.</p>
  
  <p>An example would be something like:</p>
  
  <pre><code>$date = \DateInterval::createFromString('5 minutes');
  $period = $date-&gt;doSomeMagic();
  echo $period; // should echo "PT5M"
  </code></pre>
  
  <p>Are there any built-in PHP functions to do this?  Or if there aren't, is there a library that can do it?</p>