Date.setMilliseconds() : setMilliseconds : Date JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Date » setMilliseconds »

 

Date.setMilliseconds()










Syntax








date.setMilliseconds(milliseconds)



The setMilliseconds() method sets the milliseconds in the Date object to the argument milliseconds, an integer from 0 999.

The method returns an integer representing the number of milliseconds between midnight January 1, 1970 (GMT) to the new date.












<html>
    <script language="JavaScript">
    <!--
    theDate = new Date();

    document.write("Initial milliseconds=",theDate.getTime());
    document.write("<br>setMilliseconds returned ");
    document.write(theDate.setMilliseconds(792)," milliseconds.")
    document.write("<br>Final milliseconds=",theDate.getTime());

    -->
    </script>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Date
» setMilliseconds