The information in this article applies to:
SUMMARYIn JScript 3.0, the Date.getYear() method returns the full year for years after 1999. MORE INFORMATION
In JScript 1.0, which is installed with Microsoft Internet Explorer 3.0,
the Date.getYear() method returns the current year minus 1900. So, the year
1999 returns 99 and the year 2000 returns 100.
This change was made to conform to ECMA 262, the standard on which JScript
is based.
If you always require a four-digit year value, use the Date.getFullYear() method. The following script demonstrates how to implement your own getFullYear() function that works in browsers that implement non-ECMA JavaScript:
The above script works for all years after 1000.
REFERENCES
For more information on the ECMA standard, refer to the following Web site:
http://www.ecma.ch/stand/ecma-262.htmFor information on using JScript, refer to the documentation available at the following Web site: http://msdn.microsoft.com/scripting/ Additional query words:
Keywords : kb2000 |
Last Reviewed: July 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |