It's required for https://github.com/elastic/kibana/pull/25379
I need to access a date field in a Painless script, but I don't know what its type is.
I know there are at least two possible types - Long
(epoch milliseconds) and JodaCompatibleZonedDateTime
. Probably there are more.
So I need some way to convert date from one of possible types to a single type.
The method org.elasticsearch.xpack.core.watcher.support.WatcherDateTimeUtils#convertToDate
does similar thing, but it's not available inside a Painless script.
If there is no such functionality, I can try to add it.