Set Year : Date Set « Date Time « JavaScript DHTML






Set Year

    
<html>
<body>
<button onclick="var myDate = new Date(); 
                 myDate.setYear(2000); 
                 alert(myDate);">Date set year</button>
</body>
</html>

    
      
      








Related examples in the same category

1.Set Date
2.Set Full Year
3.Set Hours
4.Set Milliseconds
5.Set Minutes
6.Set Month
7.Set Seconds
8.Set Time