ObjectId.getTimestamp()

On this page本页内容

ObjectId.getTimestamp()

Returns the timestamp portion of the ObjectId() as a Date.返回ObjectId()的时间戳部分作为日期。

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提示
See also: 参阅:
←  ObjectIdObjectId.toString() →