JavaScript DateUtils

来源:互联网 发布:知乎成都审核招聘 编辑:程序博客网 时间:2024/06/05 19:26

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;            }        }
0 0
原创粉丝点击