You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Ash .." <eq...@hotmail.com> on 2003/12/08 12:46:41 UTC

[lang] DateUtils proposal, standard date generators

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, ...

E.g.,
Calendar jobJoinDate = DateUtils.getCalendarYearsAgo(10);

Likewise,

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 
methods:

getLastMonth(), getNextMonth(), etc.

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

Ash








---------------------------------------------

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 http://www.msn.co.uk/msnmobile


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [lang] DateUtils proposal, standard date generators

Posted by Glenn Nielsen <gl...@mail.more.net>.
I just imported into jakarta-commons-sandbox a component named
Thread Benchmark (TBM).  It is designed to make testing thread
synchronization problems easier and as a clearing house for identifying
thread synchronization problems, workarounds, and alternative solutions.

The proposal can be found here:

http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-commons-sandbox/tbm/PROPOSAL.html?rev=1.1

Regards,

Glenn

Brian McCallister wrote:
> Several people, prodded by Glenn Nielson, discussed putting together a 
> project to overcome the shortcoming of Date and Calendar, ranging from 
> their pita to use-ness to their massive performance bottlenecks.
> 
> I know Glenn has had the flu so don't think he has gotten the ball 
> rolling, but this might be a better place for the date related stuff you 
> are talking about.
> 
> -Brian
> 
> On Dec 8, 2003, at 6:46 AM, Ash .. wrote:
> 
>> 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, ...
>>
>> E.g.,
>> Calendar jobJoinDate = DateUtils.getCalendarYearsAgo(10);
>>
>> Likewise,
>>
>> 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 
>> methods:
>>
>> getLastMonth(), getNextMonth(), etc.
>>
>> Request feedback. I might want to implement this, thow 
>> getDateDaysHence(val) val could be high
>> ;-)
>>
>> Ash
>>
>>
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------
>>
>> 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 http://www.msn.co.uk/msnmobile
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [lang] DateUtils proposal, standard date generators

Posted by Brian McCallister <mc...@forthillcompany.com>.
Several people, prodded by Glenn Nielson, discussed putting together a 
project to overcome the shortcoming of Date and Calendar, ranging from 
their pita to use-ness to their massive performance bottlenecks.

I know Glenn has had the flu so don't think he has gotten the ball 
rolling, but this might be a better place for the date related stuff 
you are talking about.

-Brian

On Dec 8, 2003, at 6:46 AM, Ash .. wrote:

> 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, ...
>
> E.g.,
> Calendar jobJoinDate = DateUtils.getCalendarYearsAgo(10);
>
> Likewise,
>
> 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 
> methods:
>
> getLastMonth(), getNextMonth(), etc.
>
> Request feedback. I might want to implement this, thow 
> getDateDaysHence(val) val could be high
> ;-)
>
> Ash
>
>
>
>
>
>
>
>
> ---------------------------------------------
>
> 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 http://www.msn.co.uk/msnmobile
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [lang] DateUtils proposal, standard date generators

Posted by Stephen Colebourne <sc...@btopenworld.com>.
Although apparantly simple, all date methods and concepts get complex very
quickly. For example timezone handling and daylight savings handling. These
methods don't feel like the right additions to DateUtils at the moment.

Stephen


----- Original Message -----
From: "Ash .." <eq...@hotmail.com>
> 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, ...
>
> E.g.,
> Calendar jobJoinDate = DateUtils.getCalendarYearsAgo(10);
>
> Likewise,
>
> 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
> methods:
>
> getLastMonth(), getNextMonth(), etc.
>
> Request feedback. I might want to implement this, thow
getDateDaysHence(val)
> val could be high
> ;-)
>
> Ash
>
>
>
>
>
>
>
>
> ---------------------------------------------
>
> 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 http://www.msn.co.uk/msnmobile
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org