I'm getting a timestamp from my MongoDB database, but it's coming back with precision only in the seconds:
Thu Jun 06 2013 16:15:22 GMT-0400 (Eastern Daylight Time)
I need greater granularity. Is there a way to get a MongoDB timestamp with precision in the milliseconds?
I'm making the call on my node.js server via mongoose:
var timestamp = new ObjectID().getTimestamp();
How can I get something more precise?
ObjectIds are stored with the precision of seconds and you can't change it. So if you need something of millis granularity then you have to store your own timestamp value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With