Pages

Javascript Date setYear() Method

Description:

Javascript date setYear() method sets the year for a specified date according to universal time.

Syntax:

Date.setYear(yearValue)
Note: Paramters in the bracket are always optional
Here is the detail of parameters:
  • yearValue : An integer value.

Return Value:

NA

Example:

<html>
<head>
<title>JavaScript setYear Method</title>
</head>
<body>
<script type="text/javascript">
   var dt = new Date( "Aug 28, 2008 13:30:00" );
   dt.setYear( 2000 );
   document.write( dt ); 
</script>
</body>
</html>
This will produce following result :
Mon Aug 28 13:30:00 UTC+0530 2000 
 
 
+JavaScript +JavaScript Frameworks Links +Javascript Development 
+JavaScript's and More, Software and Marketing +JavascriptU +JavaScriptOn 
+Javascript Problems +JavaScriptOn 
 +javaScript is a creek in West Virginia in the summe  
+enJineS +JavascriptU +Javascript Tutor  
   
 

No comments:

Flag Counter
| Copyright © 2013 Remote Tutor