title: How to retrieve the date from a MongoDB ObjectId using SQL
body: <p>In MongoDB you can retrieve the date from an ObjectId using the <code>getTimestamp()</code> function. How can I retrieve the date from a MongoDB ObjectId using SQL (e.g., in the case where such an ObjectId is stored in a MySQL database)?</p>
  
  <p>Example input:</p>
  
  <pre><code>507c7f79bcf86cd7994f6c0e
  </code></pre>
  
  <p>Wanted output:</p>
  
  <pre><code>2012-10-15T21:26:17Z
  </code></pre>