The FORMATTED-DATETIME function

ENTMF 

Description:

The FORMATTED-DATETIME function returns a combined date time string, in a requested format, from a supplied date in integer date form and time in standard numeric time form. The function type depends 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-DATETIME (argument-1, argument-2, argument-3, [argument-4])

Arguments

  1. Argument-1 must be literal of class alphanumeric, UTF-8 or national, that contains a combined date time format. See Date and Time Formats for details.
  2. Argument-2 must be an integer date, corresponding to the number of days since 31 December 1600; see Integer Date Form in Date and Time Formats for more details.
    Note: Setting the INTDATE Compiler directive to a value other than its default value will have an effect on this calculation.
  3. Argument-3 must be a value in standard numerical time form representing time as seconds-past-midnight; see Standard Numerical Time Form in Date and Time Formats for more details.
  4. Argument-4, if specified, is an integer representing the offset from Coordinated Universal Time (UTC) in minutes. It must have a magnitude of less than or equal 1439 (which is one minute less than a day); see UTC Offset Value in Date and Time Formats.
  5. Argument-4 must not be specified if the format in argument-1 does not request UTC or offset time. If the format in argument-1 requests UTC or offset time but argument-4 is not specified, an offset value of 0 will be assumed when evaluating the function.

Returned Values

  1. The returned value is a combined date time string containing the date in argument-2 and the time in argument-3, in the format corresponding to argument-1.
    • If the format in argument-1 requests the returned value to be expressed in UTC, the local time in argument-3 will be adjusted by the offset in argument-4.
    • If the format in argument-1 requests the returned value to be expressed in offset time, the value in argument-3 will be expressed directly in the time portion of the returned value and the offset from UTC in argument-4 will be expressed directly in the offset portion of the returned value.