DT_TO_DATE

Extracts the date portion from a date-and-time value.

Signature

    ┌──────────┐
IN ─┤DT_TO_DATE├─ OUT
    └──────────┘
FUNCTION DT_TO_DATE : DATE
  VAR_INPUT
    IN : DATE_AND_TIME;
  END_VAR
END_FUNCTION

The return type is DATE. IN is DATE_AND_TIME.

Inputs

Name

Type

Description

IN

DATE_AND_TIME

The date-and-time to extract the date from.

Outputs

Name

Type

Description

Return value

DATE

The date portion of IN, with the time-of-day stripped.

Description

Extracts the date portion from IN by stripping the time-of-day component, returning a DATE value representing midnight of the same day.

The long-form alias DATE_AND_TIME_TO_DATE is also supported.

Example

result := DT_TO_DATE(DT#2000-01-01-12:00:00);

See Also

References