August 1999
Intermediate to advanced
1488 pages
72h 53m
English
date.getFullYear()
The getFullYear() method returns the year in local time as a full four-digit number.
The code in Listing 6.73 displays the year using the getFullYear() method.
<html>
<script language="JavaScript">
<!-- Hide
//Create a Date object that contains the current date and time.
theDate = new Date();
//Display the full year
document.write("The year is ",theDate.getFullYear());
//Hide End -->
</script>
</html>
|
Read now
Unlock full access