public final class IntervalYearToMonth extends AbstractInterval
INTERVAL YEAR(x) TO MONTH(y). It supports
conversions to and from strings and from a number of months.
In Exasol this data type represents a time difference consisting of the following components:
Since months are the highest resolution, each interval can also be expressed as a total number of months. This is also the recommended way to represent the interval values in other systems which do not natively support this data type.
positive, value| Modifier and Type | Method and Description |
|---|---|
static IntervalYearToMonth |
ofMonths(long value)
Create an
IntervalDayToSecond from a number of months |
static IntervalYearToMonth |
parse(String text)
Parse an
IntervalDayToSecond from a string |
long |
toMonths()
Get the interval as the total number of months between two points in time
|
String |
toString() |
getSign, getSignedValue, parseMatchingGroupToLongpublic long toMonths()
public static IntervalYearToMonth ofMonths(long value)
IntervalDayToSecond from a number of monthsvalue - total length of the interval in monthspublic static IntervalYearToMonth parse(String text)
IntervalDayToSecond from a string
The accepted format is:
YYYYYYYYY:MM
Where
text - string representing an intervalCopyright © 2018–2021. All rights reserved.