title: How to return ISO date format in PHP for MongoDB?
body: <p>I want to store the current date generated from PHP into MongoDB collection as an ISO date formate.</p>
  
  <pre><code>ISODate("2012-11-02T08:40:12.569Z")
  </code></pre>
  
  <p>However I am not able to generate such Kind of <strong>date</strong> in php which will be stored in MongoDB as an <strong>ISODate</strong> format.</p>
  
  <p>This is what I ve done.</p>
  
  <pre><code> $d = new MongoDate(time());
   echo $d;
  </code></pre>
  
  <p>and it is outputting something like,</p>
  
  <pre><code>0.00000000 1353305590
  </code></pre>
  
  <p>which is not the format I need. How to do this?</p>