<!doctype html> <html> <head> <meta charset="utf-8"> <title>获取当前时间所在周的日期</title> <script> //优化整合以后的代码 function displayDate02(){ var date = new Date(); var year = date.getFullYear(); var mouths = date.getMonth()+1; var day = date.getDate(); var weekDay = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];