Formats the interval showing the interval units included in the from/to range. Possible interval units to include in the interval formatting are YEAR, MONTH, DAYS, HOURS, MINUTES, SECONDS, MILLISECONDS, MICROSECODNS. YEAR and MONTH will show data, only if the interval was created specifing them. The interval units that correspond to hour are reexpressed if possible. The DAYS interval unit is never reexpressed, as the HOURS are not reexpressed into DAYS. Having an interval like: interval =Interval.valueOf("100M30d125m") display interval.format(YEARS, MICROSECONDS) ==> shows: 8Y4M30d2h5m display interval.format(YEARS, HOURS) ==> shows: 8Y4M30d2h display interval.format(HOURS, MICROSECONDS) ==> shows: 2h5m
| Name | Type | Description | Mode |
|---|---|---|---|
| from | Enum IntervalUnit(YEARS,MONTHS,DAYS,HOURS,MINUTES,SECONDS,MILLISECONDS,MICROSECONDS) | IntervalUnit to format the interval from | in |
| to | Enum IntervalUnit(YEARS,MONTHS,DAYS,HOURS,MINUTES,SECONDS,MILLISECONDS,MICROSECONDS) | IntervalUnit to format the interval to | in |