Oracle® Fusion Middleware Idoc Script Reference Guide 11g Release 1 (11.1.1) E10726-01 |
|
Previous |
Next |
Home > Idoc Script Reference Guide > Management and Configuratio... > formatDateOnly
Reformats a date/time to the default date format and strips out the time.
Database-formatted dates cannot be evaluated (for example, 2000-02-02).
Long-formatted dates cannot be evaluated (for example, June 12, 2001).
Type and Usage
Parameters
The only parameter is a string that specifies a date/time.
Output
Returns the date only in the format used by dateCurrent (for example, 7/12/00).
Returns null if the parameter cannot be evaluated.
Example
Returns the current date only (for example, 9/12/01):
<$formatDateOnly(dateCurrent())$>
Returns the date ten days in the future (for example, 9/22/01):
<$formatDateOnly(dateCurrent(10))$>
Formats the date and time and displays the date only as 1/17/00:
<$formatDateOnly("01/17/2000 2:00 PM")$>
This script displays the current date and a date 100 days in the future. Line one assigns the current date only to a custom variable. Line two assigns a date 100 days in the future to a second custom variable. Line three displays these dates to a user (for example, Start Date: 10/12/01 and End Date: 1/20/02):
<$my_startDate = formatDateOnly(dateCurrent())$> <$my_endDate = formatDateOnly(dateCurrent(100))$> Start Date: <$my_startDate$> and End Date: <$my_endDate$>