ObjectId.getTimestamp()
On this page本页内容
ObjectId.getTimestamp()
-
Returns the timestamp portion of the返回ObjectId()
as a Date.ObjectId()
的时间戳部分作为Date。
Example示例
The following example calls the 以下示例对getTimestamp()
method on an ObjectId()
:ObjectId()
调用getTimestamp()
方法:
ObjectId("507c7f79bcf86cd7994f6c0e").getTimestamp()
This will return the following output:这将返回以下输出:
ISODate("2012-10-15T21:26:17Z")
Tip