Created
January 26, 2016 02:18
-
-
Save dsernst/4785535fb3282e41219e to your computer and use it in GitHub Desktop.
Convert a Gmail datetime into an ISODate for Mongo
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
// Convert a Gmail datetime into an ISODate for Mongo | |
function gmailToIso(string) { | |
return 'ISODate("' + new Date(string.split('at ').join('')).toISOString() + '")' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment