Skip to content

Instantly share code, notes, and snippets.

@rep
Created December 18, 2012 17:55
Show Gist options
  • Save rep/4330344 to your computer and use it in GitHub Desktop.
Save rep/4330344 to your computer and use it in GitHub Desktop.
pure JS getTimestamp for BSON ObjectID
function oidDate(e){
return new Date(parseInt(e.substring(0,8),16)*1e3)
};
oidDate("50c5c0e8db1434180bfb062b")
Mon Dec 10 2012 12:00:56 GMT+0100 (CET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment