To convert a Google spreadsheet date to a javascript date :
var JSdate = Date.parse(Cell.getValue())
To convert a javascript date to a Google spreadsheet date:
function GoogleDate( JSdate ) {
var D = new Date(JSdate) ;
var Null = new Date(Date.UTC(1899,11,30,0,0,0,0)) ; // the starting value for Google
return ((D.getTime() - Null.getTime())/60000 - D.getTimezoneOffset()) / 1440 ;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…