How get DateTime Format on PHP: 2016-01-29T09:29:29.5033083+03:00
<p>Who can say that over time, the date format is used here?</p>

<pre><code>&lt;Date&gt;2016-01-29T09:29:29.5033083+03:00&lt;/Date&gt;
</code></pre>

<p>I tried to do it on php$time = microtime();</p>

<pre><code>list($usec, $sec) = explode(" ", $time);
$datetime = new DateTime();
$datetime-&gt;setTimestamp($time);
$usec = $usec * 1000000;
echo date('Y-m-d\TH:i:s.'.$usec.'P') . "&lt;hr&gt;";
</code></pre>

<p>Result:</p>

<pre><code> 2016-05-19T12:52:04.415507+05:00
</code></pre>

<p>But the number of characters is not the same:</p>

<pre><code>.5033083
.415507
</code></pre>

<p>How do I get this format to php?</p>

<pre><code>&lt;Date&gt;2016-01-29T09:29:29.5033083+03:00&lt;/Date&gt;
</code></pre>