Facing MapperParsingException[failed to parse [date]]

(john rabindranath) #1

Hi Team ,
can anyone help me to resolve this issue ?

while converting milliseconds to date facing this exception while indexing time ,
Date dates = new Date(1532390400000L);
Date convertedDate = new SimpleDateFormat("yyyy-MM-dd").parse(fmt.format(dates));

SimpleDateFormat fmts = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

		String stringifiedJson = mapper.writeValueAsString(elasticUpdated);

		bulkRequests.add(esclient.prepareIndex("index", "type", elasticUpdated.getId())

essage [MapperParsingException[failed to parse 2018-11-01 07:11:54; nested: IllegalArgumentException[Invalid format: "2018-07-24 00:00:00" is malformed at " 00:00:00"];]

(Christoph) #2

What does "fmt" refer to?

(john rabindranath) #3

hi @cbuescher,

fmt refer to below one
SimpleDateFormat fmts = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

(system) #4

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