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






Syntax

date.setDate(day)

The setDate() method sets the day of the month in the Date object to the argument day, an integer from 1 to 31.

The method returns an integer representing the number of milliseconds between midnight January 1, 1970 (GMT) to the date and time specified in the Date object after the day of the month has been adjusted.

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

    document.write("Initial milliseconds=",theDate.getTime());
    document.write("<br>setDate returned ");
    document.write(theDate.setDate(4)," milliseconds.")
    document.write("<br>Final milliseconds=",theDate.getTime());
    -->
    </script>
    </html>








12.26.setDate
12.26.1.Date.setDate()