js 获取当前年月日时分秒以及星期几
2017-11-07 14:51
281 查看
$("#aa").click(function () { var date = new Date(); this.year = date.getFullYear(); this.month = date.getMonth() + 1; this.date = date.getDate(); this.day = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六")[date.getDay()]; this.hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(); this.minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(); this.second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); var currentTime = "现在是:" + this.year + "年" + this.month + "月" + this.date + "日 " + this.hour + ":" + this.minute + ":" + this.second + " " + this.day; alert(currentTime); });
相关文章推荐
- ios开发 获取系统时间 取得当前的年月日,当前的时分秒获得,周几和星期几获得
- js 获取当前年月日时分秒星期
- JS获取当前时间年月日时分秒
- js 获取当前年月日时分秒星期
- js 当前获取时间 年月日 星期几
- js 获取当前年月日时分秒星期
- js 获取当前年月日时分秒星期
- 在JS中如何获得当前年月日时分秒,时间戳,以及具体的时间分类(最全)
- js 获取当前年月日时分秒星期
- js获取当前时间的年月日时分秒
- js 获取当前年月日时分秒星期
- js 获取当前年月日时分秒星期
- js 获取当前时间以及星期几
- JS获取当前完整的url地址以及参数的方法
- C 获取时间,包括 年月日,时分秒,以及分别获得
- JS获取当前对象大小以及屏幕分辨率等
- JS获取当前对象大小以及屏幕分辨率等
- JS获取当前对象大小以及屏幕分辨率等
- Java获取当前时间的年月日时分秒方法
- javascript获取当前时间年月日时分秒