private static final long MILLISECONDS_IN_SECOND = 1000;
private static final long SECONDS_IN_MINUTE = 60;
private static final long MINUTES_IN_HOUR = 60;
private static final long HOURS_IN_DAY = 24;
private static final long MILLISECONDS_IN_DAY = MILLISECONDS_IN_SECOND *
SECONDS_IN_MINUTE *
MINUTES_IN_HOUR *
HOURS_IN_DAY;
public Date addDays (Date date, int days)
{
return new Date (date.getTime () + (days * MILLISECONDS_IN_DAY));
}
Saturday, August 20, 2011
Find date after / before in java
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment