Skip Headers

Oracle® OLAP DML Reference
10g Release 1 (10.1)

Part Number B10339-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

TODAY

The TODAY function returns the current date as a DATE value.

Return Value

DATE

Syntax

TODAY

Notes


Format of the Date

When you display the result returned by TODAY, the value has the format specified by the date template in the DATEFORMAT option. When the day of the week or the name of the month is used in the date template, TODAY uses the day names specified in the DAYNAMES option and the month names specified in the MONTHNAMES option. You can use the result returned by TODAY anywhere that a DATE value is expected.


DATE-to-TEXT Conversion

You can also use the result where a text value is expected. TODAY automatically converts the date to a text value, using the current template in the DATEFORMAT option to format the text value. When you want to override the current DATEFORMAT template, you can convert the date result to text by using the CONVERT function with a date-format argument.

Examples

Example 23-26 Displaying Today's Date

The following statements send the current date in DATE format to the current outfile.

DATEFORMAT = '<wtextl> <mtextl> <d>, <yyyy>'
SHOW TODAY

When the current date is January 15, 1996, then these statements produce the following output.

Monday January 15, 1996

Example 23-27 Calculating a Date Using the TODAY Function

The following statement calculates the date 60 days from today.

SHOW TODAY + 60

When the current date is January 15, 1996, then this statement produces the following output.

Friday March 15, 1996