Home Segments Index Top Previous Next

538: Mainline

You can add or subtract a specified number of days to a Date instance, and you can determine the number of days between two Date instances:

Workspace
Date1 := Date newDay: 1 year: 2000. 
Date2 := Date1 addDays: 30. 
DateHandle3 := Date1 subtractDays: 30. 
Transcript show: Date1 printString; cr; 
           show: Date2 printString; cr; 
           show: DateHandle3 printString; cr; 
           show: (Date2 subtractDate: DateHandle3) printString 
Transcript 
Jan  1, 2000 
Jan 31, 2000 
Dec  2, 1999 
60