Skip to content
js
function getDate(excelTimestamp){
    if (typeof excelTimestamp !== 'number' || isNaN(excelTimestamp)) return null;
    //使用JavaScript转换unix时间戳需要将时间戳再*1000
    return new Date(((excelTimestamp-70*365-19)*86400-8*3600)*1000);
}
getDate(45904) // Thu Sep 04 2025 00:00:00 GMT+0800 (中国标准时间)