Last active
May 4, 2016 19:37
-
-
Save joshuaebowling/2bab849e9307bb3268ee1b3757dac2a0 to your computer and use it in GitHub Desktop.
Parse javasscript date to OrientDB date format yyyy-MM-dd HH:mm:ss
This file contains hidden or 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
/** parameters | |
//inDate example: Wed, 04 May 2016 19:25:26 GMT | |
//inMonth example: 4 (which would month number of May if during May you new Date().getMonth()) | |
**/ | |
var strTime, utcDate; | |
utcDate = inDate.split(' '); | |
arrTime = utcDate[4].split(':'); | |
return [utcDate[3], ('0'+(parseInt(inMonth) + 1).toString()).slice(-2), utcDate[1], [arrTime[0], arrTime[1], arrTime[2]].join(':')].join(' '); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment