ES|QL TO_DATE_NANOS function
field-
Input value. The input can be a single- or multi-valued column or an expression.
Converts an input to a nanosecond-resolution date value (aka date_nanos).
Note
The range for date nanos is 1970-01-01T00:00:00.000000000Z to 2262-04-11T23:47:16.854775807Z, attempting to convert values outside of that range will result in null with a warning. Additionally, integers cannot be converted into date nanos, as the range of integer nanoseconds only covers about 2 seconds after epoch.
| field | result |
|---|---|
| date | date_nanos |
| date_nanos | date_nanos |
| double | date_nanos |
| keyword | date_nanos |
| long | date_nanos |
| text | date_nanos |
| unsigned_long | date_nanos |
FROM date_nanos
| WHERE MV_MIN(nanos) < TO_DATE_NANOS("2023-10-23T12:27:28.948Z")
AND millis > "2000-01-01"
| SORT nanos DESC
| millis:date | nanos:date_nanos | num:long |
|---|---|---|
| 2023-10-23T12:15:03.360Z | 2023-10-23T12:15:03.360103847Z | 1698063303360103847 |
| 2023-10-23T12:15:03.360Z | 2023-10-23T12:15:03.360103847Z | 1698063303360103847 |