Date
The Date class represents a day of the year. Date instances are immutable. The constructors are accessible from scripts.
Fields
| Field | Type | Description |
|---|---|---|
daysFromSunday | integer | Read only. The day of the week as a difference from Sunday: 0 for Sunday, 1 for Monday, etc. |
Methods
init( )
Constructs a new Date instance for the current date.
init( year, month, day )
Constructs a new Date instance for the given
year,monthandday.
equals( object )
Returns
Trueif object represents the same date as self.
compareTo( date )
Returns 0 if the
daterepresented by the argument is equal to the date represented by this Date, less than 0 if the date of this Date is before the date represented by the argument, and greater than 0 if the date of this Calendar is after the date represented by the argument.
day( )
Returns the day, from 1 to 31.
month( )
Returns the month, from 0 to 11.
year( )
Returns the year.
weekday( )
Returns the day of the week, from 1 (Sunday) to 7 (Saturday), same as the constants in the Java Calendar class.
addDays( days )
Returns a new Date instance representing a date with the given number of
daysadded to the date represented by this Date. The argument days can be negative.
addDays( workdays, workweek )
Returns a new Date instance representing a date with the given number of
workdaysadded to the date represented by this Date and properly considering the Workweek represented by the parameterworkweek. The argumentworkdayscan be negative.