Javascript GetYear() Function

The getYear() function of date object returns year (in minutes) of the specified date. Use it for example to get year (in minutes) of the specified date.

Syntax

dateObj.getYear()

Javascript GetYear() Function Example

<html>
<head>
<script type="text/javascript">
//Creating date object
var my_date0=new Date();  
var my_date1=new Date(88,09,12,13,14,00); 

document.write(my_date0.getYear() + "</br>");
document.write(my_date1.getYear() + "</br>");
</script>
</head>
<body>
</body>
</html>

This will produce following result

115
88