You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Taras Ledkov <ta...@gmail.com> on 2012/01/25 21:02:46 UTC

[lang] What about Duration class? (org.apache.commons.lang.time)

I'm very sorry if this problem has been solved in some way.
But i found only discussions about duration & joda-time dated 2004.
(http://markmail.org/thread/733yqv5zwzsngj3j)
Now i really need in Duration functionality (especially such as
Duration.parse(String)).

I don't understand the Commons point on this issue.

- Commons Lang doesn't need in own implementation of this
functionality and you suggest use joda-time?
- Commons Lang needs in simple & lightweight implementation of Duration?

Also i cannot find correspond issue in jira (but Eric Crampton in 2004
wrote about
"Commons Lang task list that there is a need for DateRange/Duration classes").

-- 
With best regards,
Taras Ledkov
Mail-To(JID): taras.ledkov@gmail.com
skype: taras_ledkov

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


Re: [lang] What about Duration class? (org.apache.commons.lang.time)

Posted by Luc Maisonobe <Lu...@free.fr>.
Hi,

Le 25/01/2012 21:17, Benedikt Ritter a écrit :
> Am 25.01.2012 21:02, schrieb Taras Ledkov:
>> I'm very sorry if this problem has been solved in some way.
> 
> No need to be sorry, as everybody can see, you did some research on this
> topic ;-)
> 
>> But i found only discussions about duration&  joda-time dated 2004.
>> (http://markmail.org/thread/733yqv5zwzsngj3j)
>> Now i really need in Duration functionality (especially such as
>> Duration.parse(String)).

If you want, there are several time-related classes in Orekit (see
<https://www.orekit.org/forge/projects/orekit/repository/revisions/master/show/src/main/java/org/orekit/time>),
including classes that are able to parse ISO-8601 format (see
DateComponents and TimeComponents). Orekit is distributed under the
terms of the Apache license, and I lead this project, so we can borrow
some code from Orekit and push it into any Commons components.

Orekit does handle duration, even taking into account non-regular time
scales like UTC (i.e. it knows how to handle leap seconds introduction
for time range that extend across a leap second).

I can help on this if you want.

Luc

>>
> 
> I heard about joda-time a while ago. My impression is, that the joda
> project is not that active anymore (please correct me, if I'm wrong). So
> I would vouch for additions to lang regarding durations. What I'm also
> really missing in lang.time is conversation of durations. For example:
> DurationUtils.convertToMinutes(long seconds).
> 
>> I don't understand the Commons point on this issue.
>>
>> - Commons Lang doesn't need in own implementation of this
>> functionality and you suggest use joda-time?
>> - Commons Lang needs in simple&  lightweight implementation of Duration?
>>
>> Also i cannot find correspond issue in jira (but Eric Crampton in 2004
>> wrote about
>> "Commons Lang task list that there is a need for DateRange/Duration
>> classes").
>>
> 
> As you said, it is a while ago, since this was discussed. So let's
> review this topic again.
> 
> What are your thoughts?
> 
> Regards
> Benedikt
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


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


Re: [lang] What about Duration class? (org.apache.commons.lang.time)

Posted by Ralph Goers <ra...@dslextreme.com>.
On Jan 26, 2012, at 3:35 PM, Gary Gregory wrote:

>> 
>> Just to clarify: Joda is not entering the JDK. JSR-310 has been proposed and might make it into the JDK, but JSR-310 is not Joda.
>> 
>> http://jcp.org/en/jsr/detail?id=310
> 
> Is this jsr dead? What's the next step?

See http://sourceforge.net/apps/mediawiki/threeten/index.php?title=ThreeTen. If you look at github you will notice that it is still being worked on.

Ralph

Re: [lang] What about Duration class? (org.apache.commons.lang.time)

Posted by Gary Gregory <ga...@gmail.com>.
On Jan 26, 2012, at 10:47, Adrian Crum
<ad...@sandglass-software.com> wrote:

> On 1/26/2012 6:59 AM, Henri Yandell wrote:
>> On Wed, Jan 25, 2012 at 2:14 PM, Christian Grobmeier
>> <gr...@gmail.com>  wrote:
>>> On Wed, Jan 25, 2012 at 9:17 PM, Benedikt Ritter
>>> <be...@systemoutprintln.de>  wrote:
>>>>> But i found only discussions about duration&    joda-time dated 2004.
>>>>>
>>>>> (http://markmail.org/thread/733yqv5zwzsngj3j)
>>>>> Now i really need in Duration functionality (especially such as
>>>>> Duration.parse(String)).
>>>>>
>>>> I heard about joda-time a while ago. My impression is, that the joda project
>>>> is not that active anymore (please correct me, if I'm wrong). So I would
>>>> vouch for additions to lang regarding durations. What I'm also really
>>>> missing in lang.time is conversation of durations. For example:
>>>> DurationUtils.convertToMinutes(long seconds).
>>> Joda Time is imho a great lib. Before a few weeks I replaced all the
>>> JDK stuff with Joda and it really saved my life. There was a release
>>> in July 2011 or so and my impression is more this lib is stable and
>>> does not need many releases. Actually I can't imagine a feature I miss
>>> in Joda at the moment.
>>>
>>>>> I don't understand the Commons point on this issue.
>>>>>
>>>>> - Commons Lang doesn't need in own implementation of this
>>>>> functionality and you suggest use joda-time?
>>>>> - Commons Lang needs in simple&    lightweight implementation of Duration?
>>>>>
>>>>> Also i cannot find correspond issue in jira (but Eric Crampton in 2004
>>>>> wrote about
>>>>> "Commons Lang task list that there is a need for DateRange/Duration
>>>>> classes").
>>>> As you said, it is a while ago, since this was discussed. So let's review
>>>> this topic again.
>>>>
>>>> What are your thoughts?
>>> Hen (who is mainly behind lang) and Gary already mentioned, they don't
>>> want to replicate Joda code into [lang]. I don't see any reasons why
>>> we should do that now. Instead I would prefer to mark the time package
>>> as deprecated and point users to joda. time does rely on jdk classes
>>> and as I have found out by own experience, it is dangerous to work
>>> with them.
>> Long-term vision wise; my expectation is to drop our time package like
>> a lead balloon as soon as Joda enters the JDK :)
>
> Just to clarify: Joda is not entering the JDK. JSR-310 has been proposed and might make it into the JDK, but JSR-310 is not Joda.
>
> http://jcp.org/en/jsr/detail?id=310

Is this jsr dead? What's the next step?

Gary

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

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


Re: [lang] What about Duration class? (org.apache.commons.lang.time)

Posted by Adrian Crum <ad...@sandglass-software.com>.
On 1/26/2012 6:59 AM, Henri Yandell wrote:
> On Wed, Jan 25, 2012 at 2:14 PM, Christian Grobmeier
> <gr...@gmail.com>  wrote:
>> On Wed, Jan 25, 2012 at 9:17 PM, Benedikt Ritter
>> <be...@systemoutprintln.de>  wrote:
>>>> But i found only discussions about duration&    joda-time dated 2004.
>>>>
>>>> (http://markmail.org/thread/733yqv5zwzsngj3j)
>>>> Now i really need in Duration functionality (especially such as
>>>> Duration.parse(String)).
>>>>
>>> I heard about joda-time a while ago. My impression is, that the joda project
>>> is not that active anymore (please correct me, if I'm wrong). So I would
>>> vouch for additions to lang regarding durations. What I'm also really
>>> missing in lang.time is conversation of durations. For example:
>>> DurationUtils.convertToMinutes(long seconds).
>> Joda Time is imho a great lib. Before a few weeks I replaced all the
>> JDK stuff with Joda and it really saved my life. There was a release
>> in July 2011 or so and my impression is more this lib is stable and
>> does not need many releases. Actually I can't imagine a feature I miss
>> in Joda at the moment.
>>
>>>> I don't understand the Commons point on this issue.
>>>>
>>>> - Commons Lang doesn't need in own implementation of this
>>>> functionality and you suggest use joda-time?
>>>> - Commons Lang needs in simple&    lightweight implementation of Duration?
>>>>
>>>> Also i cannot find correspond issue in jira (but Eric Crampton in 2004
>>>> wrote about
>>>> "Commons Lang task list that there is a need for DateRange/Duration
>>>> classes").
>>> As you said, it is a while ago, since this was discussed. So let's review
>>> this topic again.
>>>
>>> What are your thoughts?
>> Hen (who is mainly behind lang) and Gary already mentioned, they don't
>> want to replicate Joda code into [lang]. I don't see any reasons why
>> we should do that now. Instead I would prefer to mark the time package
>> as deprecated and point users to joda. time does rely on jdk classes
>> and as I have found out by own experience, it is dangerous to work
>> with them.
> Long-term vision wise; my expectation is to drop our time package like
> a lead balloon as soon as Joda enters the JDK :)

Just to clarify: Joda is not entering the JDK. JSR-310 has been proposed 
and might make it into the JDK, but JSR-310 is not Joda.

http://jcp.org/en/jsr/detail?id=310

-Adrian


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


Re: [lang] What about Duration class? (org.apache.commons.lang.time)

Posted by Henri Yandell <fl...@gmail.com>.
On Wed, Jan 25, 2012 at 2:14 PM, Christian Grobmeier
<gr...@gmail.com> wrote:
> On Wed, Jan 25, 2012 at 9:17 PM, Benedikt Ritter
> <be...@systemoutprintln.de> wrote:
>>> But i found only discussions about duration&  joda-time dated 2004.
>>>
>>> (http://markmail.org/thread/733yqv5zwzsngj3j)
>>> Now i really need in Duration functionality (especially such as
>>> Duration.parse(String)).
>>>
>> I heard about joda-time a while ago. My impression is, that the joda project
>> is not that active anymore (please correct me, if I'm wrong). So I would
>> vouch for additions to lang regarding durations. What I'm also really
>> missing in lang.time is conversation of durations. For example:
>> DurationUtils.convertToMinutes(long seconds).
>
> Joda Time is imho a great lib. Before a few weeks I replaced all the
> JDK stuff with Joda and it really saved my life. There was a release
> in July 2011 or so and my impression is more this lib is stable and
> does not need many releases. Actually I can't imagine a feature I miss
> in Joda at the moment.
>
>>
>>> I don't understand the Commons point on this issue.
>>>
>>> - Commons Lang doesn't need in own implementation of this
>>> functionality and you suggest use joda-time?
>>> - Commons Lang needs in simple&  lightweight implementation of Duration?
>>>
>>> Also i cannot find correspond issue in jira (but Eric Crampton in 2004
>>> wrote about
>>> "Commons Lang task list that there is a need for DateRange/Duration
>>> classes").
>>
>> As you said, it is a while ago, since this was discussed. So let's review
>> this topic again.
>>
>> What are your thoughts?
>
> Hen (who is mainly behind lang) and Gary already mentioned, they don't
> want to replicate Joda code into [lang]. I don't see any reasons why
> we should do that now. Instead I would prefer to mark the time package
> as deprecated and point users to joda. time does rely on jdk classes
> and as I have found out by own experience, it is dangerous to work
> with them.

Long-term vision wise; my expectation is to drop our time package like
a lead balloon as soon as Joda enters the JDK :)

I'd love to see a Commons Time then created on top of the Joda code
for any additons; or do it in Commons Lang if it's not going to grow
that big. I'm not sure what Stephen's plan might be once Joda is in
the JDK - probably a long vacation :)

Hen

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


Re: [lang] What about Duration class? (org.apache.commons.lang.time)

Posted by Matt Benson <gu...@gmail.com>.
On Wed, Jan 25, 2012 at 4:14 PM, Christian Grobmeier
<gr...@gmail.com> wrote:
> On Wed, Jan 25, 2012 at 9:17 PM, Benedikt Ritter
> <be...@systemoutprintln.de> wrote:
>>> But i found only discussions about duration&  joda-time dated 2004.
>>>
>>> (http://markmail.org/thread/733yqv5zwzsngj3j)
>>> Now i really need in Duration functionality (especially such as
>>> Duration.parse(String)).
>>>
>> I heard about joda-time a while ago. My impression is, that the joda project
>> is not that active anymore (please correct me, if I'm wrong). So I would
>> vouch for additions to lang regarding durations. What I'm also really
>> missing in lang.time is conversation of durations. For example:
>> DurationUtils.convertToMinutes(long seconds).
>
> Joda Time is imho a great lib. Before a few weeks I replaced all the
> JDK stuff with Joda and it really saved my life. There was a release
> in July 2011 or so and my impression is more this lib is stable and
> does not need many releases. Actually I can't imagine a feature I miss
> in Joda at the moment.
>
>>
>>> I don't understand the Commons point on this issue.
>>>
>>> - Commons Lang doesn't need in own implementation of this
>>> functionality and you suggest use joda-time?
>>> - Commons Lang needs in simple&  lightweight implementation of Duration?
>>>
>>> Also i cannot find correspond issue in jira (but Eric Crampton in 2004
>>> wrote about
>>> "Commons Lang task list that there is a need for DateRange/Duration
>>> classes").
>>
>> As you said, it is a while ago, since this was discussed. So let's review
>> this topic again.
>>
>> What are your thoughts?
>
> Hen (who is mainly behind lang) and Gary already mentioned, they don't
> want to replicate Joda code into [lang]. I don't see any reasons why
> we should do that now. Instead I would prefer to mark the time package
> as deprecated and point users to joda. time does rely on jdk classes
> and as I have found out by own experience, it is dangerous to work
> with them.

If you need any more reasons to use joda-time, consider its primary
author, Stephen Colebourne:

1.  Stephen is a Commons developer in any event; an Apache pedigree is
not reason enough to duplicate his work here, but if we did, the
resulting library would probably look like joda-time!
2.  Stephen is also one of the key experts behind JSR-310 aka
threeten, thus the future of dates and times in Java is already
heavily based on the design of and lessons learned from joda-time.

Matt

>
> Cheers
> Christian
>
>>
>> Regards
>> Benedikt
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
>
>
> --
> http://www.grobmeier.de
> https://www.timeandbill.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

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


Re: [lang] What about Duration class? (org.apache.commons.lang.time)

Posted by Christian Grobmeier <gr...@gmail.com>.
On Wed, Jan 25, 2012 at 9:17 PM, Benedikt Ritter
<be...@systemoutprintln.de> wrote:
>> But i found only discussions about duration&  joda-time dated 2004.
>>
>> (http://markmail.org/thread/733yqv5zwzsngj3j)
>> Now i really need in Duration functionality (especially such as
>> Duration.parse(String)).
>>
> I heard about joda-time a while ago. My impression is, that the joda project
> is not that active anymore (please correct me, if I'm wrong). So I would
> vouch for additions to lang regarding durations. What I'm also really
> missing in lang.time is conversation of durations. For example:
> DurationUtils.convertToMinutes(long seconds).

Joda Time is imho a great lib. Before a few weeks I replaced all the
JDK stuff with Joda and it really saved my life. There was a release
in July 2011 or so and my impression is more this lib is stable and
does not need many releases. Actually I can't imagine a feature I miss
in Joda at the moment.

>
>> I don't understand the Commons point on this issue.
>>
>> - Commons Lang doesn't need in own implementation of this
>> functionality and you suggest use joda-time?
>> - Commons Lang needs in simple&  lightweight implementation of Duration?
>>
>> Also i cannot find correspond issue in jira (but Eric Crampton in 2004
>> wrote about
>> "Commons Lang task list that there is a need for DateRange/Duration
>> classes").
>
> As you said, it is a while ago, since this was discussed. So let's review
> this topic again.
>
> What are your thoughts?

Hen (who is mainly behind lang) and Gary already mentioned, they don't
want to replicate Joda code into [lang]. I don't see any reasons why
we should do that now. Instead I would prefer to mark the time package
as deprecated and point users to joda. time does rely on jdk classes
and as I have found out by own experience, it is dangerous to work
with them.

Cheers
Christian

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



-- 
http://www.grobmeier.de
https://www.timeandbill.de

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


Re: [lang] What about Duration class? (org.apache.commons.lang.time)

Posted by Gary Gregory <ga...@gmail.com>.
My view is to use joda-time. It is a full featured library. No need to
reinvent the wheel.

Gary

On Jan 25, 2012, at 14:17, Benedikt Ritter <be...@systemoutprintln.de> wrote:

> Am 25.01.2012 21:02, schrieb Taras Ledkov:
>> I'm very sorry if this problem has been solved in some way.
>
> No need to be sorry, as everybody can see, you did some research on this topic ;-)
>
>> But i found only discussions about duration&  joda-time dated 2004.
>> (http://markmail.org/thread/733yqv5zwzsngj3j)
>> Now i really need in Duration functionality (especially such as
>> Duration.parse(String)).
>>
>
> I heard about joda-time a while ago. My impression is, that the joda project is not that active anymore (please correct me, if I'm wrong). So I would vouch for additions to lang regarding durations. What I'm also really missing in lang.time is conversation of durations. For example: DurationUtils.convertToMinutes(long seconds).
>
>> I don't understand the Commons point on this issue.
>>
>> - Commons Lang doesn't need in own implementation of this
>> functionality and you suggest use joda-time?
>> - Commons Lang needs in simple&  lightweight implementation of Duration?
>>
>> Also i cannot find correspond issue in jira (but Eric Crampton in 2004
>> wrote about
>> "Commons Lang task list that there is a need for DateRange/Duration classes").
>>
>
> As you said, it is a while ago, since this was discussed. So let's review this topic again.
>
> What are your thoughts?
>
> Regards
> Benedikt
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

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


Re: [lang] What about Duration class? (org.apache.commons.lang.time)

Posted by Benedikt Ritter <be...@systemoutprintln.de>.
Am 25.01.2012 21:02, schrieb Taras Ledkov:
> I'm very sorry if this problem has been solved in some way.

No need to be sorry, as everybody can see, you did some research on this 
topic ;-)

> But i found only discussions about duration&  joda-time dated 2004.
> (http://markmail.org/thread/733yqv5zwzsngj3j)
> Now i really need in Duration functionality (especially such as
> Duration.parse(String)).
>

I heard about joda-time a while ago. My impression is, that the joda 
project is not that active anymore (please correct me, if I'm wrong). So 
I would vouch for additions to lang regarding durations. What I'm also 
really missing in lang.time is conversation of durations. For example: 
DurationUtils.convertToMinutes(long seconds).

> I don't understand the Commons point on this issue.
>
> - Commons Lang doesn't need in own implementation of this
> functionality and you suggest use joda-time?
> - Commons Lang needs in simple&  lightweight implementation of Duration?
>
> Also i cannot find correspond issue in jira (but Eric Crampton in 2004
> wrote about
> "Commons Lang task list that there is a need for DateRange/Duration classes").
>

As you said, it is a while ago, since this was discussed. So let's 
review this topic again.

What are your thoughts?

Regards
Benedikt


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