Hi, I am getting the dynamic method error .
dynamic method [java.time.ZonedDateTime, toString/1] not found.
the issue sis related to datetime field.
epoch = (doc['field'].value).tostring("MM.dd.yyyy HH:mm:ss");
Could anyone help?
Hi, I am getting the dynamic method error .
dynamic method [java.time.ZonedDateTime, toString/1] not found.
the issue sis related to datetime field.
epoch = (doc['field'].value).tostring("MM.dd.yyyy HH:mm:ss");
Could anyone help?
The toString() method on this class does not take an argument. See ZonedDateTime (Java SE 11 & JDK 11 )
Have a look at https://www.baeldung.com/java-format-zoned-datetime-string
Try:
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM.dd.yyyy HH:mm:ss");
String formattedString = (doc['field'].value).format(formatter);
© 2020. All Rights Reserved - Elasticsearch
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.