Định nghĩa Date getMilliseconds() trong JavaScript

Phương thức date getMilliseconds() trong Javascript trả về mili giây của ngày đã cho theo Local time. Giá trị được trả về bởi getMilliseconds() là một số giữa 0 và 999.

Cú pháp Date getMilliseconds() trong JavaScript

Cú pháp của nó như sau:

Date.getMilliseconds()

Trả về giá trị

  • Trả về mili giây của ngày đã cho theo Local time.

Ví dụ minh họa Date getMilliseconds() trong JavaScript

<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>

Kết quả

getMilliseconds() : 261

Viết câu trả lời

Drop Images

0 Bình luận