Date
Last updated
Last updated
The Date class represents a day of the year. Date instances are immutable. The constructors are accessible from scripts.
init( )
Constructs a new Date instance for the current date.
init( year, month, day )
Constructs a new Date instance for the given
year
,month
andday
.
equals( object )
Returns
True
if object represents the same date as self.
compareTo( date )
Returns 0 if the
date
represented 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.
addDays( days )
Returns a new Date instance representing a date with the given number of
days
added 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
workdays
added to the date represented by this Date and properly considering the Workweek represented by the parameterworkweek
. The argumentworkdays
can be negative.
Field
Type
Description
day
integer
Read only. The day, from 1 to 31.
month
integer
Read only. The month, from 0 to 11.
year
integer
Read only. The year.
weekday
integer
Read only. The day of the week, from 0 to 6.
daysFromSunday
integer
Read only. The day of the week as a difference from Sunday: 0 for Sunday, 1 for Monday, etc.