- 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 SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum 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- 
YEARThe year. Corresponds toChronoField.YEARsemantics.
- 
MONTHThe month. Corresponds toChronoField.MONTH_OF_YEARsemantics.
- 
DAYThe day. Corresponds toChronoField.DAY_OF_MONTHsemantics.
- 
HOURThe hour. Corresponds toChronoField.HOUR_OF_DAYsemantics.
- 
MINUTEThe minute. Corresponds toChronoField.MINUTE_OF_HOURsemantics.
- 
SECONDThe second. Corresponds toChronoField.SECOND_OF_MINUTEsemantics.
- 
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.
- 
NANOSECONDThe nanosecond.
- 
MILLENNIUMThe millennium. The year 2000 is in the 2nd millennium, the year 2001 in the 3rd.
- 
CENTURYThe century. The year 2000 is in the 20th century, the year 2001 in the 21st.
- 
DECADEThe 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.
- 
QUARTERThe 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.
- 
TIMEZONEThe timezone offset in seconds. Corresponds toChronoField.OFFSET_SECONDS.
- 
TIMEZONE_HOURThe 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- 
valuesReturns 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
 
- 
valueOfReturns 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 name
- NullPointerException- if the argument is null
 
- 
toSQL
- 
toKeyword
- 
toName
 
-