function time(){ var now = new Date(); var year = now.getFullYear(); var month = now.getMonth(); var day = now.getDate(); } alert(time()); 查看完整描述