您的位置:首页 > Web前端 > JavaScript

JavaScript DateUtils

2016-03-03 11:00 489 查看
DateUtils

function DateUtils(){

this.dataObj = new Date();

this.now = this.dataObj.getFullYear() + "-" + ((this.dataObj.getMonth()+1) > 9 ? (this.dataObj.getMonth()+1) : ("0" + (this.dataObj.getMonth()+1))) + "-" + (this.dataObj.getDate() > 9 ? this.dataObj.getDate() : ("0" + this.dataObj.getDate()));

this.firstDay = this.dataObj.getFullYear() + "-01-01";

this.getNow = function() {
return this.now;
}
this.getFirstDay = function() {
return this.firstDay;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: