var year=Date.getFullyear(); var year = Date.getFullyear(); 此时,必须使用getFullYear()方法,如果使用 getYear(),则返回的是一个3位数。