I want to transform a Instant time to Date but I'm getting this error:
freemarker.template.TemplateException: Expected hash. newDate evaluated instead to freemarker.template.SimpleDate
I'm doing this on Java:
Date newDate = new Date();
Instant instant = Instant.now();
webContext.put("newDate",new Date());
webContext.put("instant",instant);
And I'm doing this on Freemarker:
[#assign dateFormated = newDate.getAsDate().from(instant.ofEpochSecond(data.time.seconds))/]
Thank you
See Question&Answers more detail:os