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

DateUtils equal & compare functions up to most significant field

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.0
    • lang.*
    • None

    Description

      DateUtils.truncate() is great to get rid of all data except the most significant field. I suggest two new methods to perform comparisons of the like. This would be especially useful in integration tests with databases where precision is based on the column type (date vs. timestamps).

       
      DateUtils.equals(Date d1, Date d2, int field);
      DateUtils.compareTo(Date d1, Date d2, int field);
      

      Attachments

        Activity

          People

            pbenedict Paul Benedict
            pbenedict Paul Benedict
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: