Skip to content

Instantly share code, notes, and snippets.

@riywo
Created April 5, 2013 21:31
Show Gist options
  • Save riywo/5322782 to your computer and use it in GitHub Desktop.
Save riywo/5322782 to your computer and use it in GitHub Desktop.
a way of mongo Timestamp pretty printing
> db.foo.findOne().t
Timestamp(1365195372000, 1)
> Timestamp.prototype.toString = function() { return new Date(this.getTime()); }
> db.foo.findOne().t
Fri Apr 05 2013 13:56:12 GMT-0700 (PDT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment