var year = date.getFullYear()
var month = date.getMonth()+1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
alert(year+'年'+month+'月'+day+'日 '+hour':'+minute+':'+second)
js是获取日期如下:<script language="javascript">
var dt = new Date()
m=dt.getMonth()+1//获得月份
wk=dt.getDay()//获取星期
d=dt.getDate()+1//获取日
y=dt.getFullYear() //获取年(四位)
document.write(m + "月" + d + "日 星期" + wk + " " + y + "年" )
</script>