getCurrentDate

来源:互联网 发布:svg js设置 transform 编辑:程序博客网 时间:2024/06/06 10:39

承接上篇获取当地日期,这篇写获取日期。
纯无聊,手写代码如下,

function getDate(){            this.currentDate = new Date();            this.year = currentDate.getFullYear();            this.month = currentDate.getMonth() + 1;            this.day = currentDate.getDate();            currentDate = [];            currentDate.push(this.year);            currentDate.push(this.month);            currentDate.push(this.day);            document.write(this.currentDate.join("-"));        }        getDate();

测试结果:
chrome/firefox/opera/safari/ie11/ie10:2017-7-6;
也就是说,ie678都不支持。
但是是不是我选用的测试工具不行?以上使用的是ietester;
我换用一下微软自己开发的super preview
测试ie67都可以。
现在问题来了?这个结果到底准不准呢?大牛们都是怎么测试兼容性的呢?

原创粉丝点击