Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'ObjectId' object has no attribute 'getTimeStamp'

I'm trying to get the timestamp from an ObjectID, but Mongo keeps giving me this error. Am I missing an import? What's the best way to convert the timestamp to a standard date format?

video['date'] = video['_id'].getTimeStamp()
like image 654
zakdances Avatar asked Sep 02 '25 15:09

zakdances


1 Answers

Where'd you see getTimeStamp() as a method?

According to the docs it should just be:

video['date'] = video['_id'].generation_time
like image 79
Eric Hulser Avatar answered Sep 05 '25 06:09

Eric Hulser