User Guide

260 Chapter 2: ActionScript Language Reference
Date.setDate()
Availability
Flash Player 5.
Usage
my_date.setDate(date) : Number
Parameters
date
An integer from 1 to 31.
Returns
An integer.
Description
Method; sets the day of the month for the specified Date object, according to local time, and
returns the new time in milliseconds. Local time is determined by the operating system on which
Flash Player is running.
Example
The following example initially creates a new Date object, setting the date to May 15, 2004, and
uses
Date.setDate() to change the date to May 25, 2004:
var today_date:Date = new Date(2004,4,15);
trace(today_date.getDate()); //displays 15
today_date.setDate(25);
trace(today_date.getDate()); //displays 25