Php Datetime convert to RFC 3339 string date to datetime type
<p>I need a  datetime  as <code>RFC3339</code> its for an api request from their documentation </p>

<p>parameter type:datetime </p>

<p>format : RFC3339</p>

<p>example: <code>1970-01-01T00:00:00Z</code></p>

<p>Here is my code for convert datetime to RFC3339</p>

<pre><code>$datetime= date("c", strtotime("2014-03-10 05:40:00")); 
</code></pre>

<p>it gives <code>2014-03-10T05:40:00+01:00</code> ,but i will get error message from the    api it says wrong date parameter</p>

<p><code>var_dump($datetime)</code> gives type as <code>string</code> but i need the type as <code>datetime</code> so how can i convert RFC339 string  date to datetime?</p>