Date().getFullYear() : getFullYear : Date JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Date » getFullYear »

 

Date().getFullYear()







The getFullYear() method returns the year in local time as a full four-digit number.












<html>
<head>
<title>Combine Date Values</title>
</head>
<body>
<script language="JavaScript" type="text/javascript">
<!--

var months = new Array(12);
months[0"January";
months[1"February";
months[2"March";
months[3"April";
months[4"May";
months[5"June";
months[6"July";
months[7"August";
months[8"September";
months[9"October";
months[10"November";
months[11"December";

var current_date = new Date();
month_value = current_date.getMonth();
day_value = current_date.getDate();
year_value = current_date.getFullYear();

document.write("The current date is " + months[month_value" " +
day_value + ", " + year_value);

//-->
</script>
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Date
» getFullYear