Created
May 24, 2012 16:40
-
-
Save christopherscott/2782634 to your computer and use it in GitHub Desktop.
Revisions
-
christopherscott revised this gist
May 24, 2012 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,11 +4,13 @@ // @return {Date} function getJsDateFromExcel(excelDate) { // JavaScript dates can be constructed by passing milliseconds // since the Unix epoch (January 1, 1970) example: new Date(12312512312); // 1. Subtract number of days between Jan 1, 1900 and Jan 1, 1970, plus 1 (Google "excel leap year bug") // 2. Convert to milliseconds. return new Date((excelDate - (25567 + 1))*86400*1000); } -
christopherscott renamed this gist
May 24, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
christopherscott created this gist
May 24, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ // Convert Excel dates into JS date objects // // @param excelDate {Number} // @return {Date} function getJsDateFromExcel(excelDate) { // JavaScript dates can be constructed by passing milliseconds // since the Unix epoch (January 1, 1970) example: // new Date(12312512312); // Subtract number of days between Jan 1, 1900 and Jan 1, 1970, // plus 1 (Google "excel leap year bug") and convert to milliseconds. return new Date((excelDate - (25567 + 1))*86400*1000); }