The javascript Date.getYear() method returns the year on the specified date according to universal time. getYear is no longer used and has been replaced by the getFullYear method.
The value returned by getYear is the current year minus 1900 (in JavaScript 1.2) and the returned year is either a 2 or 4 digit year, for example, if the year is 2026, the returned value is 2026 so test this Before function, please make sure the JavaScript version.
Grammar
Date.getYear()
Here are the details of the parameters:
Return value:
Returns the year of the specified date according to universal time.
Example:
<html> <head> <title>JavaScript getYear Method</title> </head> <body> <script type="text/javascript"> var dt = new Date(); document.write("getYear() : " + dt.getYear() ); </script> </body> </html>
This will produce the following results for 2012:
getYear() : 212