Date.getYear() : getYear : Date JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Date » getYear »

 

Date.getYear()








The getYear() method returns the year portion of the Date object.

The year is represented as either a two-digit number or a four-digit number, depending on the browser version.












<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!--
dateVar = new Date();
alert(dateVar.getYear());
//  -->
</script>
</head>
<body>

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Date
» getYear