We will see a display like this when using Firefox on some websites:
Current time is: January 26, 2018
And IE browser displays normal:
Current time is: January 26, 2008
The reason is the compatibility issue of javascript
var today = new date();var year = today.getYear();
In Firefox getYear returns the value of "current year-1900", and Microsoft has made a change:
When the year of today is greater than or equal to 2000, directly add 1900 to the returned 200X (rather than 10X)
For example: today year is 1999 Return to 99
Today year is 2000 Return to 2000
A simple solution is to add a judgment:
year = (year<1900?(1900+year):year);
There are other methods:
Called via getFullYear getUTCFullYear
var year = today.getFullYear();