You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Alex Marshall (JIRA)" <ji...@apache.org> on 2007/05/21 02:45:16 UTC
[jira] Created: (LANG-335) Comparisons of Dates and Calendars to
second precision
Comparisons of Dates and Calendars to second precision
------------------------------------------------------
Key: LANG-335
URL: https://issues.apache.org/jira/browse/LANG-335
Project: Commons Lang
Issue Type: New Feature
Affects Versions: 2.3
Environment: Windows, JDK 1.6.0, Eclipse 3.2
Reporter: Alex Marshall
Priority: Trivial
The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Closed: (LANG-335) Comparisons of Dates and Calendars to
second precision
Posted by "Alex Marshall (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Marshall closed LANG-335.
------------------------------
Since this won't be fixed and an acceptable resolution for the original request has been found, the issue is closed.
> Comparisons of Dates and Calendars to second precision
> ------------------------------------------------------
>
> Key: LANG-335
> URL: https://issues.apache.org/jira/browse/LANG-335
> Project: Commons Lang
> Issue Type: New Feature
> Affects Versions: 2.3
> Environment: Windows, JDK 1.6.0, Eclipse 3.2
> Reporter: Alex Marshall
> Priority: Trivial
>
> The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Commented: (LANG-335) Comparisons of Dates and Calendars to
second precision
Posted by "Stephen Colebourne (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497837 ]
Stephen Colebourne commented on LANG-335:
-----------------------------------------
Joda-Time, DateTimeComparator
> Comparisons of Dates and Calendars to second precision
> ------------------------------------------------------
>
> Key: LANG-335
> URL: https://issues.apache.org/jira/browse/LANG-335
> Project: Commons Lang
> Issue Type: New Feature
> Affects Versions: 2.3
> Environment: Windows, JDK 1.6.0, Eclipse 3.2
> Reporter: Alex Marshall
> Priority: Trivial
>
> The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
RE: [jira] Commented: (LANG-335) Comparisons of Dates and Calendars
to second precision
Posted by Gary Gregory <gg...@seagullsoftware.com>.
Hello:
I am pointing to Joda-Time in general for date and time issues as it is a comprehensive open source solution. It is my understanding that we have not enhanced [lang] in this department because we do not want to end up with a Joda-Time-like component within [lang].
Thank you,
Gary
________________________________
From: Alex Marshall [mailto:alex@myatmonline.com]
Sent: Monday, May 21, 2007 12:01 PM
To: Jakarta Commons Developers List
Subject: Re: [jira] Commented: (LANG-335) Comparisons of Dates and Calendars to second precision
I've looked at the Joda-Time API and it doesn't look like there's anything that would be
nearly as efficient as the simple bit-math that's used to do the calculations in the JDK implementation.
Admittedly I'm not that familiar with the library, so if there is a better way, I'm open
to being corrected.
Alex Marshall
Software Developer
Email: alex@myatmonline.com<ma...@myatmonline.com>
MSN Messenger: am-132@hotmail.com<ma...@hotmail.com>
ICQ: 137350791
Skype username: alex.marshall
Office: 1-888-286-2010 Ext 229
Fax: 1-780-484-0538
------------------------------------------------------------------------
CONFIDENTIAL: This message, including any attachments, may contain
confidential and/or privileged information, which is intended solely for
the use of the addressee(s). Any unauthorized review, use, disclosure,
or distribution is prohibited. If you are not the intended recipient,
please contact the sender and destroy all copies of the original
message.
Gary Gregory (JIRA) wrote:
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497532 ]
Gary Gregory commented on LANG-335:
-----------------------------------
Would Joda-TIme help here?
Comparisons of Dates and Calendars to second precision
------------------------------------------------------
Key: LANG-335
URL: https://issues.apache.org/jira/browse/LANG-335
Project: Commons Lang
Issue Type: New Feature
Affects Versions: 2.3
Environment: Windows, JDK 1.6.0, Eclipse 3.2
Reporter: Alex Marshall
Priority: Trivial
The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
Re: [jira] Commented: (LANG-335) Comparisons of Dates and Calendars
to second precision
Posted by Alex Marshall <al...@myatmonline.com>.
I've looked at the Joda-Time API and it doesn't look like there's
anything that would be
nearly as efficient as the simple bit-math that's used to do the
calculations in the JDK implementation.
Admittedly I'm not that familiar with the library, so if there is a
better way, I'm open
to being corrected.
Alex Marshall
Software Developer
Email: alex@myatmonline.com
MSN Messenger: am-132@hotmail.com
ICQ: 137350791
Skype username: alex.marshall
Office: 1-888-286-2010 Ext 229
Fax: 1-780-484-0538
------------------------------------------------------------------------
CONFIDENTIAL: This message, including any attachments, may contain
confidential and/or privileged information, which is intended solely for
the use of the addressee(s). Any unauthorized review, use, disclosure,
or distribution is prohibited. If you are not the intended recipient,
please contact the sender and destroy all copies of the original
message.
Gary Gregory (JIRA) wrote:
> [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497532 ]
>
> Gary Gregory commented on LANG-335:
> -----------------------------------
>
> Would Joda-TIme help here?
>
>
>> Comparisons of Dates and Calendars to second precision
>> ------------------------------------------------------
>>
>> Key: LANG-335
>> URL: https://issues.apache.org/jira/browse/LANG-335
>> Project: Commons Lang
>> Issue Type: New Feature
>> Affects Versions: 2.3
>> Environment: Windows, JDK 1.6.0, Eclipse 3.2
>> Reporter: Alex Marshall
>> Priority: Trivial
>>
>> The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
>>
>
>
[jira] Commented: (LANG-335) Comparisons of Dates and Calendars to
second precision
Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497532 ]
Gary Gregory commented on LANG-335:
-----------------------------------
Would Joda-TIme help here?
> Comparisons of Dates and Calendars to second precision
> ------------------------------------------------------
>
> Key: LANG-335
> URL: https://issues.apache.org/jira/browse/LANG-335
> Project: Commons Lang
> Issue Type: New Feature
> Affects Versions: 2.3
> Environment: Windows, JDK 1.6.0, Eclipse 3.2
> Reporter: Alex Marshall
> Priority: Trivial
>
> The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Updated: (LANG-335) Comparisons of Dates and Calendars to
second precision
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton updated LANG-335:
---------------------------------
Attachment: (was: DateUtilsExtensions.java)
> Comparisons of Dates and Calendars to second precision
> ------------------------------------------------------
>
> Key: LANG-335
> URL: https://issues.apache.org/jira/browse/LANG-335
> Project: Commons Lang
> Issue Type: New Feature
> Affects Versions: 2.3
> Environment: Windows, JDK 1.6.0, Eclipse 3.2
> Reporter: Alex Marshall
> Priority: Trivial
>
> The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Commented: (LANG-335) Comparisons of Dates and Calendars to
second precision
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497521 ]
Niall Pemberton commented on LANG-335:
--------------------------------------
I've deleted the attachment
> Comparisons of Dates and Calendars to second precision
> ------------------------------------------------------
>
> Key: LANG-335
> URL: https://issues.apache.org/jira/browse/LANG-335
> Project: Commons Lang
> Issue Type: New Feature
> Affects Versions: 2.3
> Environment: Windows, JDK 1.6.0, Eclipse 3.2
> Reporter: Alex Marshall
> Priority: Trivial
>
> The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Resolved: (LANG-335) Comparisons of Dates and Calendars to
second precision
Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton resolved LANG-335.
----------------------------------
Resolution: Won't Fix
When attaching your code to this ticket you chose the "Grant license to ASF for inclusion in ASF works (as per the Apache Software License[1]" option. However in order to be able to grant a license to the ASF for the work you need to be either be the copyright/license holder of that work or that work must be licensed in way compatible[2] with the Apache Software License.
Sun's license for JDK 1.6.0 does not give you the authority to grant the ASF a license for the work, therefore this cannot be considered. More details on the Apache Software License and 3rd party works are available in the following locations:
http://www.apache.org/licenses/LICENSE-2.0
http://people.apache.org/~cliffs/3party.html
You need to be very careful about copying other peoples work since if you infringe someone elses intellectual property rights then you are at risk of being sued.
> Comparisons of Dates and Calendars to second precision
> ------------------------------------------------------
>
> Key: LANG-335
> URL: https://issues.apache.org/jira/browse/LANG-335
> Project: Commons Lang
> Issue Type: New Feature
> Affects Versions: 2.3
> Environment: Windows, JDK 1.6.0, Eclipse 3.2
> Reporter: Alex Marshall
> Priority: Trivial
> Attachments: DateUtilsExtensions.java
>
>
> The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Commented: (LANG-335) Comparisons of Dates and Calendars to
second precision
Posted by "Alex Marshall (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497544 ]
Alex Marshall commented on LANG-335:
------------------------------------
> You need to be very careful about copying other peoples work since if you infringe someone elses intellectual property rights then you are at risk of being sued.
Ok, fair enough. I'll be the first to admit that I wasn't sufficiently prudent, but I still think this is a bit of functionality that many developers could benefit from and
that it should be included with DateUtils
> Comparisons of Dates and Calendars to second precision
> ------------------------------------------------------
>
> Key: LANG-335
> URL: https://issues.apache.org/jira/browse/LANG-335
> Project: Commons Lang
> Issue Type: New Feature
> Affects Versions: 2.3
> Environment: Windows, JDK 1.6.0, Eclipse 3.2
> Reporter: Alex Marshall
> Priority: Trivial
>
> The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
[jira] Commented: (LANG-335) Comparisons of Dates and Calendars to
second precision
Posted by "Alex Marshall (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497893 ]
Alex Marshall commented on LANG-335:
------------------------------------
That'll do the trick for me. Thank you kindly Stephen.
> Comparisons of Dates and Calendars to second precision
> ------------------------------------------------------
>
> Key: LANG-335
> URL: https://issues.apache.org/jira/browse/LANG-335
> Project: Commons Lang
> Issue Type: New Feature
> Affects Versions: 2.3
> Environment: Windows, JDK 1.6.0, Eclipse 3.2
> Reporter: Alex Marshall
> Priority: Trivial
>
> The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [jira] Updated: (LANG-335) Comparisons of Dates and Calendars to second precision
Posted by Niall Pemberton <ni...@gmail.com>.
On 5/21/07, Niall Pemberton <ni...@gmail.com> wrote:
> On 5/21/07, Thorbjørn Ravn Andersen <th...@gmail.com> wrote:
> > Alex Marshall (JIRA) skrev den 21-05-2007 02:49:
> > > [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> > >
> > > Alex Marshall updated LANG-335:
> > > -------------------------------
> > >
> > > Attachment: DateUtilsExtensions.java
> > >
> > > DateUtilsExtensions.java contains sample implementations for equals and hashCode that were taken straight from the Sun 1.6.0 JDK implementation and modified to provide equals and hashCode functions to second-level precision.
> > >
> > Clarify me on this - is it allowed to use GPL code in Apache projects?
>
> No, but this is even worse since JDK 1.6.0 source code is not under
> the GPL license or any kind of FOSS license.
btw thanks for highlighting this - I've closed the ticket and deleted
the attachment
> Niall
>
> > --
> >
> > Thorbjørn
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [jira] Updated: (LANG-335) Comparisons of Dates and Calendars to second precision
Posted by Niall Pemberton <ni...@gmail.com>.
On 5/21/07, Thorbjørn Ravn Andersen <th...@gmail.com> wrote:
> Alex Marshall (JIRA) skrev den 21-05-2007 02:49:
> > [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> >
> > Alex Marshall updated LANG-335:
> > -------------------------------
> >
> > Attachment: DateUtilsExtensions.java
> >
> > DateUtilsExtensions.java contains sample implementations for equals and hashCode that were taken straight from the Sun 1.6.0 JDK implementation and modified to provide equals and hashCode functions to second-level precision.
> >
> Clarify me on this - is it allowed to use GPL code in Apache projects?
No, but this is even worse since JDK 1.6.0 source code is not under
the GPL license or any kind of FOSS license.
Niall
> --
>
> Thorbjørn
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [jira] Updated: (LANG-335) Comparisons of Dates and Calendars
to second precision
Posted by Thorbjørn Ravn Andersen <th...@gmail.com>.
Alex Marshall (JIRA) skrev den 21-05-2007 02:49:
> [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Alex Marshall updated LANG-335:
> -------------------------------
>
> Attachment: DateUtilsExtensions.java
>
> DateUtilsExtensions.java contains sample implementations for equals and hashCode that were taken straight from the Sun 1.6.0 JDK implementation and modified to provide equals and hashCode functions to second-level precision.
>
Clarify me on this - is it allowed to use GPL code in Apache projects?
--
Thorbjørn
[jira] Updated: (LANG-335) Comparisons of Dates and Calendars to
second precision
Posted by "Alex Marshall (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Marshall updated LANG-335:
-------------------------------
Attachment: DateUtilsExtensions.java
DateUtilsExtensions.java contains sample implementations for equals and hashCode that were taken straight from the Sun 1.6.0 JDK implementation and modified to provide equals and hashCode functions to second-level precision.
> Comparisons of Dates and Calendars to second precision
> ------------------------------------------------------
>
> Key: LANG-335
> URL: https://issues.apache.org/jira/browse/LANG-335
> Project: Commons Lang
> Issue Type: New Feature
> Affects Versions: 2.3
> Environment: Windows, JDK 1.6.0, Eclipse 3.2
> Reporter: Alex Marshall
> Priority: Trivial
> Attachments: DateUtilsExtensions.java
>
>
> The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond. The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database. In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org