首先,上代码 var diffDate = function(date, diff) { return new Date( Date.UTC( date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds() ) + diff ); }; 其次,上原理 1 将 Date() 对象转换为UTC标准时间对应的总毫秒数…