i am differentiating two date fields and getting the time in milliseconds as output. here is my code
if(!doc['confirmedAt'].empty)
{
return doc['confirmedAt'].value.getMillis() - doc['createdAt'].value.getMillis()
}
i want to divide this by 60000 so that i can get the time in minutes. i am unable to do this. please help me.
I've never seen the use of .empty before, are you sure you don't want .size() to determine that the field exists? Here's the walkthrough documentation.
hi @wylie !! thanks for helping out. is there a way to subtract a date field from current time using painless?? I used the below code to do so but it didn't work.
DateTime.now().getMillis() - doc['createdAt'].value
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.