Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1438

Enhancement of DateUtils, or new DateTimeUtility

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • lang.time.*
    • None

    Description

      My company deals with dates quite a bit and we came up with our own DateTimeUtility which has a LOT of functionality in terms of conversions, calculations, and parsing.  I looked at DateUtils and it did not have everything we needed. Hence, the reason we built our own.  And, I do believe that what we have built is of interest to other developers.

       

      There is functionality in converting between ZonedDateTime, LocalDateTime, LocalDate, Timestamp, and Date.  The reason for the conversions is to centralize where Date and Timestamp are referenced to make it easier to get rid of once the JDBC Drivers catch up with the new java.time api.  It also helped us in converting all of our code base over to java.time.

       

      There is functionality to calculate certain standard times like: getStartOfDay() or getEndOfDay().  

       

      And there is a lot of parsing logic which I know DateUtils has.  However, we set up the common formats we use in the app.  Again, we made it easier for ourselves by centralizing our formats. This part of our utility I am not expecting DateUtils to absorb; but I am hoping the functionality mentioned above is of some interest.

       

      I thought it would be a good idea to incorporate some of the functionality we have into Apache Commons Lang.  This may be its own class, or part of DateUtils. I would be happy to help with the integration if you would like.  But would want some direction from the Commons Lang developers.  

      Also, I have included a copy of the class for you to review.

       

      Attachments

        1. DateTimeUtility.java
          24 kB
          Peter Minearo

        Activity

          People

            Unassigned Unassigned
            pminearo Peter Minearo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: