I get informations on entity via jpa . the date 31/12/2018 dd/MM/YYYY became 31/12/2019. I must be wrong on a simpledateformat option.
LOG.info("date de création :" +entite.getCreatedt ());
SimpleDateFormat sdf =new SimpleDateFormat ( "dd/MM/YYYY" );
LOG.info("date de création formatée :" + sdf.format(entite.getCreatedt ()));
the createdt field from my entity is defined as above :
@Column(name = "CREATEDT")
@Temporal(TemporalType.DATE)
private Date createdt;
I get the result : Infos: date de création :Mon Dec 31 00:00:00 CET 2018 Infos: date de création formatée :31/12/2019
can you explain why the 2018 became 2019 I tried with
sdf = new SimpleDateFormat ( "dd/MM/YYYY", new Locale("fr", "FR") );
but the result was the same
thanks