Pages

Javascript Date setMilliseconds() Method

Description:

Javascript date setMilliseconds() method sets the milliseconds for a specified date according to local time.

Syntax:

Date.setMilliseconds(millisecondsValue)
Note: Paramters in the bracket are always optional
Here is the detail of parameters:
  • millisecondsValue : A number between 0 and 999, representing the milliseconds.
If you specify a number outside the expected range, the date information in the Date object is updated accordingly. For example, if you specify 1010, the number of seconds is incremented by 1, and 10 is used for the milliseconds.

Return Value:

NA

Example:

<html>
<head>
<title>JavaScript setMilliseconds Method</title>
</head>
<body>
<script type="text/javascript">
   var dt = new Date( "Aug 28, 2008 23:30:00" );
   dt.setMilliseconds( 1010 );
   document.write( dt ); 
</script>
</body>
</html>
This will produce following result :
Thu Aug 28 23:30:01 UTC+0530 2008 
 
 
+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