title: Change format of Date field of MongoDB in php
body: <p>My collection structure is as:</p>
  
  <pre><code>{a,b,time}
  </code></pre>
  
  <p>I am inserting data in the collection through a java service where a and b are integers and time is Date field.
  On selecting a field from php I am getting the response as following:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [b] =&gt; 19511297
              [time] =&gt; Array
                  (
                      [$date] =&gt; Array
                          (
                              [$numberLong] =&gt; 1516688016000
                          )
                  )
          )
  )
  </code></pre>
  
  <p>How to get the time in the format as through the php function date('Y-m-d H:i:s) ?</p>