Mega Code Archive

 
Categories / JavaScript Tutorial / Date
 

Date setFullYear()

Syntax date.setFullYear(year) The setFullYear() method sets the year in the Date object to the argument year, a four-digit integer. The method returns an integer representing the number of milliseconds between midnight January 1, 1970 (GMT) to the new date after setting. <html>     <script language="JavaScript">     <!--     theDate = new Date();     document.write("Initial milliseconds=",theDate.getTime());     document.write("<br>setFullYear returned ");     document.write(theDate.setFullYear(2003)," milliseconds.")     document.write("<br>Final milliseconds=",theDate.getTime());     -->     </script>     </html>