[SERVER-3592] Allow creating ObjectId from Date Created: 14/Aug/11  Updated: 18/May/17  Resolved: 08/Jul/16

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Scott Hernandez (Inactive) Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Done Votes: 0
Labels: ObjectId, javascript
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

Allow some way to create a "fake" ObjectId from a Date instance; either via static method or through constructor



 Comments   
Comment by Asya Kamsky [ 08/Jul/16 ]

This is already allowed:

> new ObjectId(((new Date()).getTime()/1000).toString(16).slice(0,8)+"0000000000000000")
ObjectId("578006cc0000000000000000")

Generated at Thu Feb 08 03:03:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.