Date and time functions
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Date and time functions
The table in this topic lists the date and time functions that ODBC supports.
The date and time functions listed can take the following arguments:
-
date-exp
can be a column
name, a date or timestamp literal, or the result of another scalar function,
where the underlying data type can be represented as
SQL_CHAR,SQL_VARCHAR,SQL_DATE, orSQL_TIMESTAMP. -
time_exp
can be a column name, a timestamp or timestamp literal, or the result of another scalar function, where the underlying data type can be represented asSQL_CHAR,SQL_VARCHAR,SQL_TIME, orSQL_TIMESTAMP. -
timestamp_exp can be a column name; a time, date,
or timestamp literal; or the result of another scalar function,
where the underlying data type can be represented as
SQL_CHAR,SQL_VARCHAR,SQL_TIME,SQL_DATE, orSQL_TIMESTAMP.
| Function | Returns |
|---|---|
|
Current date. |
|
Current local time. The time-precisionargument
determines the seconds precision of the returned value. |
|
Current local date and local time as a timestamp
value. The timestamp-precision argument determines
the seconds precision of the returned timestamp. |
|
Current date as a date value. |
|
Current local time as a time value. |
|
Character string containing a date source-specific
name of the day for the day portion of date_exp. |
|
Day of the month in date_exp as
an integer value (1-31). |
|
Day of the week in date_exp as
an integer value (1-7). |
|
Day of the year in date_exp as
an integer value (1-366). |
|
Hour in time_exp as an integer
value (0-23). |
|
Minute in time_exp as an integer
value (0-59). |
|
Month in date_exp as an integer
value (1-366). |
|
Character string containing the data source-specific name of the month. |
|
Current date and time as a timestamp value. |
|
Quarter in date_exp as an integer
value (1-4). |
|
Second in date_exp as an integer
value (0-59). |
|
Timestamp calculated by adding integer_exp intervals
of type interval to time_exp.
interval can be:
|
|
Integer number of intervals of type interval
by which time_exp2 is greater than time_exp1. interval
has the same values as TIMESTAMPADD. Fractional
seconds are expressed in billionths of a second. |
|
Week of the year in date_exp as
an integer value (1-53). |
|
Year in date_exp. The range
is data source dependent. |