日期:2014-05-16 浏览次数:20420 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>獲取時間日期 </title> </head> <body> <h2> 獲取時間日期 </h2> <hr> <script language="javascript"> var weekday = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"); var dttody = new Date(); var output = dttody.getDate() + "/"; output += (dttody.getMonth() + 1) + "/"; output += dttody.getFullYear() + "<br>"; document.write("系統日期:" + output); output = dttody.getHours() + ":"; output += dttody.getMinutes() + ":"; output += dttody.getSeconds() + "<br>"; document.write("系統時間:" + output); document.write(weekday[dttody.getDay()]); </script> </body> </html>
------解决方案--------------------