The FORMATTED-CURRENT-DATE Function

ENTMF 

Description

The FORMATTED-CURRENT-DATE function returns the current date and time in the specified format. The function type is dependent on the type of argument-1 as follows:

argument-1 type Function type
Alphanumeric Alphanumeric
National National
UTF-8 UTF-8

General Format

FUNCTION FORMATTED-CURRENT-DATE (argument-1)

Arguments

  1. Argument-1 must be a literal of type alphanumeric, UTF-8 or national.
  2. Argument-1 must contain a combined data and time format; see Date and Time Formats for more details.

Returned Values

  1. The returned value is a string of the same type and length as argument-1, containing the date and time in the format requested by argument-1. The date and time are provided by the system on which the function is evaluated. The current precision supports time intervals up to one thousandth of a second.
  2. The returned value can be affected by any of the following tunables being set: current_second, current_minute, current_hour, current_day, current_month, current_year, datewarp_dynamic, and timewarp_dynamic.

Example

Using the following function on the time-stamp 2021-11-12 18:07:34.3779 generates a formatted date and time of 20211112T180734.37.

MOVE FUNCTION FORMATTED-CURRENT-DATE(“YYYYMMDDThhmmss.ss”) TO MY-VAR