Get hour + min

Hi guys,
when i want to get hour i use this scripted field
LocalDateTime.ofInstant(Instant.ofEpochMilli(doc['@timestamp'].value.millis), ZoneId.of('Asia/Tehran')).getHour()

in the past i could get hour + ":" + min . i forgot what script i wrote.
i guess it was sth like that :
LocalDateTime.ofInstant(Instant.ofEpochMilli(doc['@timestamp'].value.millis), ZoneId.of('Asia/Tehran')).getHour() + ":" + LocalDateTime.ofInstant(Instant.ofEpochMilli(doc['@timestamp'].value.millis), ZoneId.of('Asia/Tehran')).getMin

but it doesn't work for me. can anyone help me ?

https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html
getMinute() is the answr ....

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