A time interval represents a period of time between two instants. Intervals are inclusive of the start instant and exclusive of the end. The end instant is always greater than or equal to the start instant.
Intervals have a fixed millisecond duration. This is the difference between the start and end instants. The duration is represented separately by {@link ReadableDuration}. As a result, intervals are not comparable. To compare the length of two intervals, you should compare their durations.
An interval can also be converted to a {@link ReadablePeriod}. This represents the difference between the start and end points in terms of fields such as years and days.
Interval is thread-safe and immutable. @author Brian S O'Neill @author Sean Geoghegan @author Stephen Colebourne @author Julen Parra @since 1.0
{x∈Zn|mind≤ xd≤maxd;d∈{0… n-1}}
An {@link Interval} over the discrete source domain. Note that thisdoes not imply that for all coordinates in the {@link Interval} function values exist or can be generated. It only defineswhere the minimum and maximum source coordinates are. E.g. an {@link IterableInterval} has a limited number of values and a sourcecoordinate for each. By that, minimum and maximum are defined but the {@link Interval} does not define a value for all coordinates in between.
@author Stephan SaalfeldThis class represents a period of time, which may be given a label. An interval is inclusive of the start time, but excludes the end time.
@since 1.1.7 @author Peter Mahoney @version $Revision: 371736 $A time interval represents a period of time between two instants. Intervals are inclusive of the start instant and exclusive of the end. The end instant is always greater than or equal to the start instant.
Intervals have a fixed millisecond duration. This is the difference between the start and end instants. The duration is represented separately by {@link ReadableDuration}. As a result, intervals are not comparable. To compare the length of two intervals, you should compare their durations.
An interval can also be converted to a {@link ReadablePeriod}. This represents the difference between the start and end points in terms of fields such as years and days.
Interval is thread-safe and immutable. @author Brian S O'Neill @author Sean Geoghegan @author Stephen Colebourne @author Julen Parra @since 1.0
A time interval represents a period of time between two instants. Intervals are inclusive of the start instant and exclusive of the end. The end instant is always greater than or equal to the start instant.
Intervals have a fixed millisecond duration. This is the difference between the start and end instants. The duration is represented separately by {@link ReadableDuration}. As a result, intervals are not comparable. To compare the length of two intervals, you should compare their durations.
An interval can also be converted to a {@link ReadablePeriod}. This represents the difference between the start and end points in terms of fields such as years and days.
Interval is thread-safe and immutable. @author Brian S O'Neill @author Sean Geoghegan @author Stephen Colebourne @author Julen Parra @since 1.0
java.sql.Interval
data type. JDBC lacks an important data type that is present in most SQL databases: INTERVAL
. The SQL:2008 standard states that there are two types of intervals:
4.6.3 IntervalsThere are two classes of intervals. One class, called year-month intervals, has an express or implied datetime precision that includes no fields other than YEAR and MONTH, though not both are required. The other class, called day-time intervals, has an express or implied interval precision that can include any fields other than YEAR or MONTH.
INTERVAL
can be combined with date time data types according to the following operation table:
Operand 1 | Operator | Operand 2 | Result Type |
---|---|---|---|
Datetime | – | Datetime | Interval |
Datetime | + or – | Interval | Datetime |
Interval | + | Datetime | Datetime |
Interval | + or – | Interval | Interval |
Interval | * or / | Numeric | Interval |
Numeric | * | Interval | Interval |
Interval implementations can be expected to also also extend {@link Number}.
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 {@link Field#add(Field)} and {@link Field#sub(Field)} Databases that havebeen 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
:
{@link Interval} can represent anything conforming to this generaldescription, including a time interval on the domain axis, pixel bounds, or whatever. @author chad takahashi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|