public abstract class DateInterval extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DateInterval.Scale |
static class |
DateInterval.Unit |
| Modifier and Type | Method and Description |
|---|---|
static DateInterval |
between(Calendar start,
Calendar end)
Choose a suitable implementation for target date interval
|
static DateInterval |
between(Date start,
Date end)
Choose a suitable implementation for target date interval
|
abstract Double |
toDays()
Calculate a difference in full days.
|
abstract Double |
toDaysExcludeYears()
Calculate a difference in full days regarding last year.
|
abstract Double |
toDaysExcludeYearsAndMonths()
Calculate a difference in full days regarding last month.
|
abstract Double |
toMonths(DateInterval.Scale scale)
Calculate a difference in months.
|
abstract Double |
toMonthsExcludeYears(DateInterval.Scale scale)
Calculate a difference in months regarding last year.
|
abstract Double |
toWeeks(DateInterval.Scale scale)
Calculate a difference in weeks.
|
abstract Double |
toYears(DateInterval.Scale scale)
Calculate a difference in years.
|
public abstract Double toDays()
public abstract Double toWeeks(DateInterval.Scale scale)
Scale.INT - the result will be calculated in full
weeks, otherwise will contain a fractional part of a last uncompleted weekscale - specifies a scale of the resultpublic abstract Double toMonths(DateInterval.Scale scale)
Scale.INT - the result will be calculated in full
months, otherwise will contain a fractional part of a last uncompleted month
Current implementation is an equivalent to Excel native functions DATEDIF(start, end, "M")scale - specifies a scale of the resultpublic abstract Double toYears(DateInterval.Scale scale)
Scale.INT - the result will be calculated in full
years, otherwise will contain a fractional part of a last uncompleted year
Current implementation is an equivalent to Excel native functions DATEDIF(start, end, "Y")scale - specifies a scale of the resultpublic abstract Double toDaysExcludeYearsAndMonths()
public abstract Double toDaysExcludeYears()
public abstract Double toMonthsExcludeYears(DateInterval.Scale scale)
Scale.INT - the result will be
calculated in full months, otherwise will contain a fractional part of a last uncompleted month
Current implementation is an equivalent to Excel native functions DATEDIF(start, end, "YM")scale - specifies a scale of the resultpublic static DateInterval between(Date start, Date end)
start - start dateend - end datepublic static DateInterval between(Calendar start, Calendar end)
start - start dateend - end dateCopyright © 2004–2019 OpenL Tablets. All rights reserved.