does anyone has an idea on how to transform milliseconds to a datetime object? Here is my request:
ts = 1538589841191
from pymongo import MongoClient
client = MongoClient()
client = MongoClient('localhost', 27017)
db = client.local
collection = db.orderbook_update
orderbook = collection.find_one({
"lastUpdated": ts
})
and my result of orderbook[u'lastUpdated']
= 1538589841191.0
Does someone have an idea on how to transform this float into a datetime object to end up with something like: datetime.datetime(2018, 10, 3, 16, 27, 29, 198000)