码迷,mamicode.com
首页 > 编程语言 > 详细

通过javascript的日期对象来得到当前的日期

时间:2016-06-18 18:22:02      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

var currentDate = new Date();
var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
document.write(
currentDate.getFullYear() + "年" +
(currentDate.getMonth() + 1) + "月" +
currentDate.getDate() + "日" + " " +
weekday[currentDate.getDay()]
);

通过javascript的日期对象来得到当前的日期

标签:

原文地址:http://www.cnblogs.com/family-626-77/p/5596421.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!