/* // returns crmUpdate field in Zulu time zone if(doc['crmUpdate'].size() > 0) { doc['crmUpdate'].value.withZoneSameInstant(ZoneId.of('Z')) } // returns created field in Zulu time zone else if (doc['created'].size() > 0) { return doc['created'].value.withZoneSameInstant(ZoneId.of('Z')) } */ if(doc['crmUpdate'].size() > 0) { long closingTime = ChronoUnit.DAYS.between(doc['created'].value.withZoneSameInstant(ZoneId.of('Z')), doc['crmUpdate'].value.withZoneSameInstant(ZoneId.of('Z'))); closingTime }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter