commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ash .." <>
Subject [lang] DateUtils proposal, standard date generators
Date Mon, 08 Dec 2003 11:46:41 GMT
The following date generators in the o.a.c.l.t.Dateutils class might be 
useful. Requesting feedback.

public static Calendar getCalendarXxxAgo(int value)
public static Date getDateXxxAgo(int value)

Xxx = weeks, days, months, years, ...

Calendar jobJoinDate = DateUtils.getCalendarYearsAgo(10);


public static Calendar getCalendarXxxHence(int value)
public static Date getDateXxxHence(int value)

Calendar taskProcrastinationPeriod = Calendar.getCalendarDaysHence(3);

Further, the special cases of value == 1, may be provided as special 

getLastMonth(), getNextMonth(), etc.

Request feedback. I might want to implement this, thow getDateDaysHence(val) 
val could be high



Run, rabbit run.
Dig that hole, forget the sun,
And when at last the work is done
Don't sit down it's time to dig another one.

Get Hotmail on your mobile phone

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message