ES|QL TO_DATEPERIOD function
field-
Input value. The input is a valid constant date period expression.
Converts an input value into a date_period value.
| field | result |
|---|---|
| date_period | date_period |
| keyword | date_period |
| text | date_period |
ROW x = "2024-01-01"::datetime
| EVAL y = x + "3 DAYS"::date_period, z = x - TO_DATEPERIOD("3 days");
| x:datetime | y:datetime | z:datetime |
|---|---|---|
| 2024-01-01 | 2024-01-04 | 2023-12-29 |