ObjectId.getTimestamp()
On this page
This version of the documentation is archived and no longer supported. View the current documentation to learn how to upgrade your version of MongoDB server.
ObjectId.getTimestamp()
Returns the timestamp portion of the
ObjectId()
as a Date.
Example
The following example calls the getTimestamp()
method on an ObjectId()
:
ObjectId("507c7f79bcf86cd7994f6c0e").getTimestamp()
This will return the following output:
ISODate("2012-10-15T21:26:17Z")