我有简单的脚本:
function test(time) {
var dt = new Date( time * 1000 )
var sec = dt.getSeconds()
if ( sec < 10 ) sec = "0" + sec
var min = dt.getMinutes()
if ( min < 10 ) min = "0" + min
var hour = dt.getHours()
if ( hour < 10 ) hour = "0" + hour
var time = hour + ":" + min + ":" + sec
return time
预期的结果(test(1800) ) : 30:00
,但我有result: 04:30:00
。你能帮我改正这个脚本吗?我的时区 GMT+04