Here is my getter setter code :
public Date getUpdateTime() {
return UpdateTime;
}
public void setUpdateTime(Date UpdateTime) {
this.UpdateTime = UpdateTime;
}
Here is my mapping to the elasticsearch :
event.get(i).setUpdateTime(rs.getDate("UpdateTime").toLocalDate().format(formatter));
Here is my formatter:
String pattern = "MMM dd, yyyy HH:mm:ss.SSSSSSSS";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
The value coming from the database is in below format , How to get the value in the same format in elasticSearch :
2020-05-18 08:45:13