- All Implemented Interfaces:
Serializable
,Comparable<DatePart>
,Constable
A date part can be used with SQL functions such as extract(). It describes a
part of a date / datetime value
- Author:
- Lukas Eder
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe century.The day.The day of the week.The day of the year.The decade.The epoch in seconds since 1970-01-01.The hour.The ISO day of the week.The microsecond.The millennium.The millisecond.The minute.The month.The nanosecond.The quarter.The second.The timezone offset in seconds.The time zone offset's hour part.The time zone offset's minute part.The week of the year.The year. -
Method Summary
-
Enum Constant Details
-
YEAR
The year. Corresponds toChronoField.YEAR
semantics. -
MONTH
The month. Corresponds toChronoField.MONTH_OF_YEAR
semantics. -
DAY
The day. Corresponds toChronoField.DAY_OF_MONTH
semantics. -
HOUR
The hour. Corresponds toChronoField.HOUR_OF_DAY
semantics. -
MINUTE
The minute. Corresponds toChronoField.MINUTE_OF_HOUR
semantics. -
SECOND
The second. Corresponds toChronoField.SECOND_OF_MINUTE
semantics. -
MILLISECOND
@NotNull @Support({AURORA_POSTGRES,COCKROACHDB,DB2_11,H2,HSQLDB,POSTGRES,SQLSERVER}) public static final DatePart MILLISECONDThe millisecond. -
MICROSECOND
@NotNull @Support({AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2_11,H2,HSQLDB,MARIADB,MEMSQL,MYSQL,POSTGRES,SQLSERVER}) public static final DatePart MICROSECONDThe microsecond. -
NANOSECOND
The nanosecond. -
MILLENNIUM
The millennium. The year 2000 is in the 2nd millennium, the year 2001 in the 3rd. -
CENTURY
The century. The year 2000 is in the 20th century, the year 2001 in the 21st. -
DECADE
The decade. The year divided by 10. -
EPOCH
@NotNull @Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2_11,H2,HANA,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE}) public static final DatePart EPOCHThe epoch in seconds since 1970-01-01. -
QUARTER
The quarter. Jan-Mar = 1, Apr-Jun = 2, Jul-Sep = 3, Oct-Dec = 4. -
WEEK
@NotNull @Support({AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2_11,H2,HANA,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES}) public static final DatePart WEEKThe week of the year. -
DAY_OF_YEAR
@NotNull @Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2,H2,HANA,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE}) public static final DatePart DAY_OF_YEARThe day of the year. Corresponds toChronoField.DAY_OF_YEAR
. -
DAY_OF_WEEK
@NotNull @Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2,H2,HANA,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE}) public static final DatePart DAY_OF_WEEKThe day of the week. 1 = Sunday, 2 = Monday, ..., 7 = Saturday. Corresponds toChronoField.DAY_OF_WEEK
, shifted by one day. -
ISO_DAY_OF_WEEK
@NotNull @Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2,H2,HANA,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE}) public static final DatePart ISO_DAY_OF_WEEKThe ISO day of the week. 1 = Monday, 2 = Tuesday, ..., 7 = Sunday. Corresponds toChronoField.DAY_OF_WEEK
. -
TIMEZONE
The timezone offset in seconds. Corresponds toChronoField.OFFSET_SECONDS
. -
TIMEZONE_HOUR
The time zone offset's hour part. -
TIMEZONE_MINUTE
@NotNull @Support({AURORA_POSTGRES,H2,HSQLDB,POSTGRES}) public static final DatePart TIMEZONE_MINUTEThe time zone offset's minute part.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toSQL
-
toKeyword
-
toName
-