commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-400) Add DateUtils methods to implement before and after time-insensitive
Date Fri, 11 Jan 2008 15:48:33 GMT

    [ https://issues.apache.org/jira/browse/LANG-400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12558012#action_12558012
] 

Paul Benedict commented on LANG-400:
------------------------------------

Unfortunately Java has no way to just deal with dates without dealing with time too. It's
just their philosophy that dates exist on a time continuum. Anyway, truncateTime() would do
fine, but I don't think that eliminates the need for isBeforeDay/isAfterDay(). Those methods
I still need in many projects and they complement the already existing isSameDay().

> Add DateUtils methods to implement before and after time-insensitive
> --------------------------------------------------------------------
>
>                 Key: LANG-400
>                 URL: https://issues.apache.org/jira/browse/LANG-400
>             Project: Commons Lang
>          Issue Type: New Feature
>    Affects Versions: 2.3
>            Reporter: Paul Benedict
>             Fix For: 2.4
>
>
> The JDK contains Date.before() and Date.after() but no time-insensitive versions exist.
I am typically in the situation where TIMESTAMP columns are converted into Date instances
and I need to compare dates only for business rules.
> I propose to complement DateUtils.isSameDay:
> DateUtils.isBeforeDay
> DateUtils.isAfterDay
> My private implementations convert Date to Calendar, zero-out the time elements, and
then compare.
> PS: I would also deprecate isSameXXX methods in 2.4 and rename it to isEqualXXX since
sameness usually implies instance equality, rather than object equality.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message