Date functions
- Last Updated: May 9, 2024
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
The following table describes functions that return or operate on data values.
| Function | Description |
|---|---|
| DAY | Evaluates a date expression and returns a day of the month as an INTEGER value from 1 to 31, inclusive. |
| MONTH | Evaluates a date expression and returns a month INTEGER value from 1 to 12, inclusive. |
| YEAR | Evaluates a date expression and returns the year value of that date, including the century, as an INTEGER value. |
| WEEKDAY | Evaluates a date expression and returns the day of the week as an INTEGER value from 1 (Sunday) to 7 (Saturday) for that date. |
| TIME | Returns an INTEGER value representing the time as the
number of seconds since midnight. Use this function together with the
STRING function to produce the time in hours, minutes, and
seconds. |
| TODAY | Returns the current system date. |
Functions that convert data are discussed in later sections. An example of such a function is the STRING function.
To use the STRING function
to convert the time into a meaningful display:
- In the Procedure Editor, select to open a new procedure window.
- Enter the following code, which applies the
STRINGfunction to the result of theTIMEfunction, along with the formatting characters HH (hour), MM (minute), and SS (second):DISPLAY STRING(TIME, "HH:MM:SS"). - Press F2. The Procedure Editor
window appears:
