INTERVAL DAY TO SECOND
data type.
DayToSecond is a Number whose Number#intValue()
represents the (truncated) number of milliseconds of the interval,
Number#doubleValue() represents the approximative number of
milliseconds (including hours, minutes, seconds, nanoseconds) of the
interval.
Note: only a few databases actually support this data type on its own. You
can still use it for date time arithmetic in other databases, though, through
Field#add(Field) and Field#sub(Field) Databases that have
been observed to natively support INTERVAL data types are:
These dialects have been observed to partially support INTERVAL
data types in date time arithmetic functions, such as
TIMESTAMPADD, and TIMESTAMPDIFF:
Interval
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final int | |
| private final int | |
| private final int | |
| private final boolean | |
| private static final Pattern | |
| private static final Pattern | |
| private static final Pattern | |
| private static final Pattern | |
| private static final Pattern | |
| private static final Pattern | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | |
| public | DayToSecond(int days, int hours, int minutes, int seconds, int nano)
Create a new day-nanoseconds interval. |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final DayToSecond | abs()
Implements org. |
| public final int | compareTo(DayToSecond
the object to be compared. that)Implements java. |
| public static DayToSecond | |
| public static DayToSecond | |
| public static DayToSecond | Returns: The parsedINTERVAL DAY TO MINUTE object, or
null if the string could not be parsed.A string representation of the form
string)[+|-][days] [hours]:[minutes]Parse a string representation of a |
| public static DayToSecond | Returns: The parsedINTERVAL DAY TO MINUTE object, or
null if the string could not be parsed.A string representation of the form
string)[+|-][days] [hours]:[minutes]:[seconds].[fractional seconds]Parse a string representation of a |
| public final double | doubleValue()
Implements abstract java. Implements org. double.
|
| public final boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public final float | floatValue()
Implements abstract java. Implements org. float.
|
| public final int | |
| public final int | |
| public final int | |
| public final int | |
| public final int | |
| public final int | |
| public final int | |
| public final int | |
| public final double | |
| public final double | |
| public final double | |
| public final double | |
| public final double | |
| public final double | |
| public final double | |
| public final int | |
| public static DayToSecond | |
| public static DayToSecond | Returns: The parsedINTERVAL HOUR TO MINUTE object, or
null if the string could not be parsed.A string representation of the form
string)[+|-][hours]:[minutes]Parse a string representation of a |
| public static DayToSecond | Returns: The parsedINTERVAL HOUR TO SECOND object, or
null if the string could not be parsed.A string representation of the form
string)[+|-][hours]:[minutes]:[seconds].[fractional seconds]Parse a string representation of a |
| public final int | intValue()
Implements abstract java. Implements org. int.
|
| public final long | longValue()
Implements abstract java. Implements org. long.
|
| public static DayToSecond | |
| public static DayToSecond | Returns: The parsedINTERVAL MINUTE TO SECOND object, or
null if the string could not be parsed.A string representation of the form
string)[+|-][[minutes]:[seconds].[fractional seconds]Parse a string representation of a |
| public final DayToSecond | |
| public static DayToSecond | |
| public final Duration | toDuration()
Implements org. |
| public final String | |
| public static DayToSecond | |
| public static DayToSecond | |
| public static DayToSecond | |
| public static DayToSecond | valueOf(Duration duration)
Transform a |
| days | back to summary |
|---|---|
| private final int days | |
| hours | back to summary |
|---|---|
| private final int hours | |
| minutes | back to summary |
|---|---|
| private final int minutes | |
| nano | back to summary |
|---|---|
| private final int nano | |
| negative | back to summary |
|---|---|
| private final boolean negative | |
| PATTERN_DTH | back to summary |
|---|---|
| private static final Pattern PATTERN_DTH | |
| PATTERN_DTM | back to summary |
|---|---|
| private static final Pattern PATTERN_DTM | |
| PATTERN_DTS | back to summary |
|---|---|
| private static final Pattern PATTERN_DTS | |
| PATTERN_HTM | back to summary |
|---|---|
| private static final Pattern PATTERN_HTM | |
| PATTERN_HTS | back to summary |
|---|---|
| private static final Pattern PATTERN_HTS | |
| PATTERN_MTS | back to summary |
|---|---|
| private static final Pattern PATTERN_MTS | |
| seconds | back to summary |
|---|---|
| private final int seconds | |
| DayToSecond | back to summary |
|---|---|
| public DayToSecond() Create a new interval. | |
| DayToSecond | back to summary |
|---|---|
| public DayToSecond(int days) Create a new day interval. | |
| DayToSecond | back to summary |
|---|---|
| public DayToSecond(int days, int hours) Create a new day-hour interval. | |
| DayToSecond | back to summary |
|---|---|
| public DayToSecond(int days, int hours, int minutes) Create a new day-minute interval. | |
| DayToSecond | back to summary |
|---|---|
| public DayToSecond(int days, int hours, int minutes, int seconds) Create a new day-second interval. | |
| DayToSecond | back to summary |
|---|---|
| public DayToSecond(int days, int hours, int minutes, int seconds, int nano) Create a new day-nanoseconds interval. | |
| DayToSecond | back to summary |
|---|---|
| pack-priv DayToSecond(int days, int hours, int minutes, int seconds, int nano, boolean negative) | |
| abs | back to summary |
|---|---|
| public final DayToSecond abs() Implements org. Doc from org. Get the absolute value of the interval (set its sign to positive)
| |
| compareTo | back to summary |
|---|---|
| public final int compareTo(DayToSecond that) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| day | back to summary |
|---|---|
| public static DayToSecond day(String string) Parse a string representation of a
| |
| dayToHour | back to summary |
|---|---|
| public static DayToSecond dayToHour(String string) Parse a string representation of a
| |
| dayToMinute | back to summary |
|---|---|
| public static DayToSecond dayToMinute(String string) Parse a string representation of a
| |
| dayToSecond | back to summary |
|---|---|
| public static DayToSecond dayToSecond(String string) Parse a string representation of a
| |
| doubleValue | back to summary |
|---|---|
| public final double doubleValue() Implements abstract java. Implements org. Doc from java. Returns the value of the specified number as a
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| floatValue | back to summary |
|---|---|
| public final float floatValue() Implements abstract java. Implements org. Doc from java. Returns the value of the specified number as a
| |
| getDays | back to summary |
|---|---|
| public final int getDays() Get the day-part of this interval | |
| getHours | back to summary |
|---|---|
| public final int getHours() Get the hour-part of this interval | |
| getMicro | back to summary |
|---|---|
| public final int getMicro() Get the (truncated) micro-part of this interval | |
| getMilli | back to summary |
|---|---|
| public final int getMilli() Get the (truncated) milli-part of this interval | |
| getMinutes | back to summary |
|---|---|
| public final int getMinutes() Get the minute-part of this interval | |
| getNano | back to summary |
|---|---|
| public final int getNano() Get the nano-part of this interval | |
| getSeconds | back to summary |
|---|---|
| public final int getSeconds() Get the second-part of this interval | |
| getSign | back to summary |
|---|---|
| public final int getSign() Implements org. Doc from org. The sign of the interval
| |
| getTotalDays | back to summary |
|---|---|
| public final double getTotalDays() Get the whole interval in days | |
| getTotalHours | back to summary |
|---|---|
| public final double getTotalHours() Get the whole interval in hours | |
| getTotalMicro | back to summary |
|---|---|
| public final double getTotalMicro() Get the whole interval in micro-seconds | |
| getTotalMilli | back to summary |
|---|---|
| public final double getTotalMilli() Get the whole interval in milli-seconds | |
| getTotalMinutes | back to summary |
|---|---|
| public final double getTotalMinutes() Get the whole interval in minutes | |
| getTotalNano | back to summary |
|---|---|
| public final double getTotalNano() Get the whole interval in nano-seconds | |
| getTotalSeconds | back to summary |
|---|---|
| public final double getTotalSeconds() Get the whole interval in seconds | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hour | back to summary |
|---|---|
| public static DayToSecond hour(String string) Parse a string representation of a
| |
| hourToMinute | back to summary |
|---|---|
| public static DayToSecond hourToMinute(String string) Parse a string representation of a
| |
| hourToSecond | back to summary |
|---|---|
| public static DayToSecond hourToSecond(String string) Parse a string representation of a
| |
| intValue | back to summary |
|---|---|
| public final int intValue() Implements abstract java. Implements org. Doc from java. Returns the value of the specified number as an
| |
| longValue | back to summary |
|---|---|
| public final long longValue() Implements abstract java. Implements org. Doc from java. Returns the value of the specified number as a
| |
| minute | back to summary |
|---|---|
| public static DayToSecond minute(String string) Parse a string representation of a
| |
| minuteToSecond | back to summary |
|---|---|
| public static DayToSecond minuteToSecond(String string) Parse a string representation of a
| |
| neg | back to summary |
|---|---|
| public final DayToSecond neg() Implements org. Doc from org. Negate the interval (change its sign)
| |
| second | back to summary |
|---|---|
| public static DayToSecond second(String string) Parse a string representation of a
| |
| toDuration | back to summary |
|---|---|
| public final Duration toDuration() Implements org. Doc from org. Get a duration representation of this interval.
There is an obvious
This corresponds to PostgreSQL's
| |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| valueOf | back to summary |
|---|---|
| public static DayToSecond valueOf(String string) Parse a string representation of a
| |
| valueOf | back to summary |
|---|---|
| public static DayToSecond valueOf(double milli) Load a
| |
| valueOf | back to summary |
|---|---|
| public static DayToSecond valueOf(long second, int nanos) Load a
| |
| valueOf | back to summary |
|---|---|
| public static DayToSecond valueOf(Duration duration) Transform a | |