document.onLoad=function(){ document.getElementById("显示天数的元素ID").innerHTML=convert(${lostMail.time}); } function convertToDays(seconds){ var day=""; var mod=seconds%(3600*24); if(mod==0){ var count=seconds/3600/24; day=count+"天"; }else{ day=seconds/3600/24; day=count+"天"+mod+"秒"; } return day; }