Date.setSeconds() : setSeconds « Date « JavaScript Tutorial






Syntax

date.setSeconds(seconds)

The setSeconds() method sets the seconds in the Date object to the argument seconds, an integer from 0 to 59.

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>setSeconds returned ");
    document.write(theDate.setSeconds(16)," milliseconds.")
    document.write("<br>Final milliseconds=",theDate.getTime());
    -->
    </script>
    </html>








12.32.setSeconds
12.32.1.Date.setSeconds()