The information on this page applies to version 3.7 |
Object » Magnitude » Timespan » Date
Date provides methods for dealing with calendar dates in different formats. Internally, a date is represented as a Timespan with a length of one day that begins at midnight.
today
Answer the current date.
newDay: day month: month year: year
Arguments day, month and year are all integers, except month may be a string.
For compatibility, two digit dates in the range 00..49 are from 2000, 50..99 from 1900.
Please use ALWAYS four digits year numbers.
newDay: day year: year
Answer an instance of me which is dayCount days after the beginning of the year referenceYear.
leapYear: year
Answer 1 if the year yearInteger is a leap year; answer 0 if it is not.
(This method does not answer a boolean value because for the
purposes of date arithmetic, an integer value is more convenient to use.)
< aDate
Answer whether aDate follows the date of the receiver in time.
= aDate
Answer whether aDate is the same day as the receiver.
addDays: dayCount
Answer a Date that is dayCount days after the receiver.
subtractDays: dayCount
Answer a Date that is dayCount days before the receiver.
subtractDate: aDate
Answer the number of days between the receiver and aDate.