|
||||||||||||
Year 2000 ProblemQuestion: Is JavaScript code vulnerable to the Year 2000 problem? Answer: You can write your code so as to make sure that it will not suffer from "millennium bugs" even if run on older browsers. However, without special precautions, JavaScript code can be vulnerable to the Year 2000 problem. To avoid "millennium bugs", take into account the following:
The following code fragment sets the correct four-digit year in all browsers: theDate = new Date(); theYear = theDate.getYear(); if (theYear<1900) theYear=theYear+1900;
JavaScripter.net.
Copyright
© 1999-2006, Alexei Kourbatov
|