Date time difference

Hi,
can anyone help me get the date difference between to dates.
{
"script_fields": {
"my_doubled_field": {
"script": {
"lang": "painless",
"source": "new Date().gettime() - doc['datefield'].value"
}
}
}}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.