extend()

The dateTimeLib.extend() system function converts a TIMESTAMP, TIME, or DATE value into a longer or shorter TIMESTAMP value. The following examples show this process:

Syntax

  dateTimeLib.extend(
    extensionField DATE? | TIME? | TIMESTAMP? in
    [, pattern outputTimeStampPattern? in ])
  returns (result TIMESTAMP?)
extensionField

The name of a TIMESTAMP, TIME, or DATE variable. The variable contains the value to be extended or shortened.

pattern
A string literal or constant that defines the pattern of the timestamp value returned by the function. For more information, see Date/time masks and format specifiers. If pattern is a null value or omitted, the function uses one of the following default formats:
  • If extensionField is a DATE or TIME, the default format is "yyyyMMddHHmmss".
  • If extensionField is a TIMESTAMP, the default format is "yyyyMMddHHmmssffffff".
.
result

A TIMESTAMP variable. If extensionField is null, the function returns a null value.


Feedback