• JavaScript Video Tutorials

JavaScript - Date getMilliseconds() Method



Description

Javascript date getMilliseconds() method returns the milliseconds in the specified date according to local time. The value returned by getMilliseconds() is a number between 0 and 999.

Syntax

Its syntax is as follows −

Date.getMilliseconds()

Return Value

Returns the milliseconds in the specified date according to local time.

Example

Try the following example.

<html>
   <head>
      <title>JavaScript getMilliseconds Method</title>
   </head>
   
   <body>   
      <script type = "text/javascript">
         var dt = new Date( );
         document.write("getMilliseconds() : " + dt.getMilliseconds() ); 
      </script>      
   </body>
</html>

Output

javascript_date_object.htm
Advertisements