Created
December 18, 2012 17:55
-
-
Save rep/4330344 to your computer and use it in GitHub Desktop.
pure JS getTimestamp for BSON ObjectID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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