Available in versions: Dev (3.19) | Latest (3.18) | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11 | 3.10 | 3.9
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 byjava.time.LocalDate
and JDBC'sjava.sql.Date
- SQL
TIME
modelled byjava.time.LocalTime
and JDBC'sjava.sql.Time
- SQL
TIMESTAMP
modelled byjava.time.LocalDateTime
and JDBC'sjava.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 byjava.time.OffsetTime
- SQL
TIMESTAMP WITH TIME ZONE
modelled by any ofjava.time.Instant
(e.g. PostgreSQL),java.time.OffsetDateTime
(JDBC and standard SQL), as well asjava.time.ZonedDateTime
(e.g. Oracle)
Table of contents
- 4.7.12.1.
- CURRENT_DATE
- 4.7.12.2.
- CURRENT_LOCALDATE
- 4.7.12.3.
- CURRENT_LOCALDATETIME
- 4.7.12.4.
- CURRENT_LOCALTIME
- 4.7.12.5.
- CURRENT_OFFSETDATETIME
- 4.7.12.6.
- CURRENT_OFFSETTIME
- 4.7.12.7.
- CURRENT_TIME
- 4.7.12.8.
- CURRENT_TIMESTAMP
- 4.7.12.9.
- DATE
- 4.7.12.10.
- DATEADD
- 4.7.12.11.
- DATEDIFF
- 4.7.12.12.
- DATESUB
- 4.7.12.13.
- DAY
- 4.7.12.14.
- EXTRACT
- 4.7.12.15.
- HOUR
- 4.7.12.16.
- LOCALDATE
- 4.7.12.17.
- LOCALDATETIME
- 4.7.12.18.
- LOCALTIME
- 4.7.12.19.
- MINUTE
- 4.7.12.20.
- MONTH
- 4.7.12.21.
- SECOND
- 4.7.12.22.
- TIME
- 4.7.12.23.
- TIMESTAMP
- 4.7.12.24.
- TIMESTAMPADD
- 4.7.12.25.
- TO_DATE
- 4.7.12.26.
- TO_LOCALDATE
- 4.7.12.27.
- TO_LOCALDATETIME
- 4.7.12.28.
- TO_TIMESTAMP
- 4.7.12.29.
- TRUNC
- 4.7.12.30.
- YEAR
previous : next |
Feedback
Do you have any feedback about this page? We'd love to hear it!