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 |
|---|---|---|
|
|
The date-and-time to extract the date from. |
Outputs
Name |
Type |
Description |
|---|---|---|
Return value |
|
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¶
DT_TO_TOD — extract time-of-day from datetime
CONCAT_DATE_TOD — combine date and time-of-day