title: pymongo convert mongoDB date to python datetime
body: <p>I have a MongoDB database which has some time entries (eg. creation dates of some entities). When I look at them in the database, they seem to be in a 64-bit integer BSON format. The database entry was originally created using C# (ASP.NET Core) using the following representation:</p>
  
  <pre><code>[BsonRepresentation(MongoDB.Bson.BsonType.Decimal128)]
  </code></pre>
  
  <p>I want to access that database using a Python script to get some stats. I can get that entry in my python code using <code>pymongo</code>. A typical value looks like this: <code>[637013892303590646, 0]</code>. How can I convert it into a python <code>datetime</code> value that is human readable?</p>
  
  <p>If I print the variable type which I get from pymongo, it says: <code>bson.int64.Int64</code> </p>
  
  <p>I looked at the <code>bson</code> module documentation here: <a href="https://api.mongodb.com/python/current/api/bson/index.html" rel="nofollow noreferrer">https://api.mongodb.com/python/current/api/bson/index.html</a>, but I couldn't find a suitable function to do the conversion. Can someone please point me the right call to convert the <code>bson.int64.Int64</code> to a <code>datetime</code> value?</p>
  
  <p>Thanks!</p>