Return value of null

on first I wanted to used painless but I need to get the date right now this option don't exists in painless" topic get date right now in painless"

i have this answer for Elastic Team Member :
Scripted fields in Kibana simply use Elasticsearch's Painless scripting language. Unfortunately, that language can only be used to work with numbers, booleans, voids, and arrays. Since there is no way to operate on dates in the language, there is no way to calculate the difference between dates in scripted fields.

it's way i used groovy !