title: DateInterval: Unknown or bad format
body: <p>I get several <a href="https://www.w3.org/TR/xmlschema11-2/#duration" rel="nofollow">dateTime</a> informations through an API. It's format is like <code>P29DT48M56.941999S</code> for example. I would like to convert it with to a readable sting using <a href="http://php.net/manual/de/dateinterval.format.php" rel="nofollow">DateInterval::format</a>. My snippet looks like</p>
  
  <pre><code>$interval = new DateInterval('P29DT48M56.941999S');
  echo $interval-&gt;format(' %d days, %I minutes');
  </code></pre>
  
  <p>Unfortunally, I get this error:</p>
  
  <p><strong>PHP Fatal error:  Uncaught exception 'Exception' with message 'DateInterval::__construct(): Unknown or bad format (P29DT48M56.941999S)'</strong></p>
  
  <p>What's wrong and how can I fix it?</p>