Date now = new Date();
// constructs current date/time
System.out.println(now.toString());
// prints date such as
// Sat Feb 03 16:34:10 PST 2001
boolean after(Date other) |
Tests if this date is after the specified date |
boolean before(Date other) | Tests if this date is before the specified date |
int compareTo(Date other) |
Tells which date came before the other |
long getTime() |
Returns milliseconds since the epoch (1970-01-01 00:00:00 GMT) |
void setTime(long n) |
Sets the date to the given number of
milliseconds since the epoch |
int n = today.daysFrom(birthday);
Day later = today.addDays(999);
d.addDays(n).daysFrom(d) == n
d1.addDays(d2.daysFrom(d1)) == d2
(d + n) - d == n
d1 + (d2 - d1) == d2
private int year
private int month
private int date