Available in versions: Dev (3.17) | Latest (3.16) | 3.15 | 3.14 | 3.13 | 3.12 | 3.11 | 3.10 | 3.9 | 3.8 | 3.7
Datetime functions
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
Datetime functions are useful to calculate date time arithmetic and formatting.
Many functions in this section come with two flavours supporting both the JDBC datetime data types, and the JSR 310 types. These include:
- SQL
DATE
modelled by java.time.LocalDate and JDBC's java.sql.Date - SQL
TIME
modelled by java.time.LocalTime and JDBC's java.sql.Time - SQL
TIMESTAMP
modelled by java.time.LocalDateTime and JDBC's java.sql.Timestamp
Some temporal SQL data types could not be represented canonically with historic JDBC types, but only with JSR 310 types. These include:
- SQL
TIME WITH TIME ZONE
modelled by java.time.OffsetTime - SQL
TIMESTAMP WITH TIME ZONE
modelled by any of java.time.Instant (e.g. PostgreSQL), java.time.OffsetDateTime (JDBC and standard SQL), as well as java.time.ZonedDateTime (e.g. Oracle)
Table of contents
- 4.7.13.1.
- CURRENT_DATE
- 4.7.13.2.
- CURRENT_TIME
- 4.7.13.3.
- CURRENT_TIMESTAMP
- 4.7.13.4.
- DATE
- 4.7.13.5.
- DATEADD
- 4.7.13.6.
- DATEDIFF
- 4.7.13.7.
- DATESUB
- 4.7.13.8.
- DAY
- 4.7.13.9.
- EXTRACT
- 4.7.13.10.
- HOUR
- 4.7.13.11.
- MINUTE
- 4.7.13.12.
- MONTH
- 4.7.13.13.
- SECOND
- 4.7.13.14.
- TIME
- 4.7.13.15.
- TIMESTAMP
- 4.7.13.16.
- TIMESTAMPADD
- 4.7.13.17.
- TO_DATE (new)
- 4.7.13.18.
- TO_TIMESTAMP (new)
- 4.7.13.19.
- TRUNC
- 4.7.13.20.
- YEAR
The jOOQ User Manual : SQL building : Column expressions : Datetime functions | previous : next |
Feedback
Do you have any feedback about this page? We'd love to hear it!