title: Printing A MongoDB Date From PHP
body: <p>How in <code>PHP</code> do I get the regular timestamp format out of a <code>MongoDB</code> date?</p>
  
  <p>Assume I have:</p>
  
  <pre><code>$my_date;
  print_r($my_date);
  </code></pre>
  
  <p>The <code>print_r</code> output is:</p>
  
  <pre><code>MongoDate Object ( [sec] =&gt; 1346300336 [usec] =&gt; 593000 )
  </code></pre>
  
  <p>But doing:</p>
  
  <pre><code>echo $my_date;
  </code></pre>
  
  <p>Outputs:</p>
  
  <pre><code>0.59300000 1346300336
  </code></pre>
  
  <p>Even tried:</p>
  
  <pre><code>echo (string)$my_date
  </code></pre>
  
  <p>Same thing.</p>