Using Datetime in Painless Painless string to int [7.5.1] script field issue on @timestamp Ex String datetime = doc['@timestamp'].value; ZonedDateTime zdt = ZonedDateTime.parse(datetime); String ret = zdt.format(DateTimeFormatter.ISO_INSTANT); return ret; ZonedDateTime input = doc['@timestamp'].value; String output = input.format(DateTimeFormatter.ISO_INSTANT); return output; Node.js { "index": ..