Class IntervalStringUtils


public final class IntervalStringUtils extends Object
Utility class to format periods similar to Oracle's representation of "INTERVAL * to *" data type.
  • Method Details

    • formatIntervalYear

      public static String formatIntervalYear(Period p)
      Formats a period similar to Oracle INTERVAL YEAR TO MONTH data type
      . For example, the string "+21-02" defines an interval of 21 years and 2 months.
    • formatIntervalDay

      public static String formatIntervalDay(Duration d)
      Formats a period similar to Oracle INTERVAL DAY TO SECOND data type.
      . For example, the string "-001 18:25:16.766" defines an interval of - 1 day 18 hours 25 minutes 16 seconds and 766 milliseconds.