When a date type field is saved in the database, it is saved with a date from a previous day

0

I am programming an application with the following technologies:

  • Java, Spring, Hibernate, Maven, Msql.

The IDE that I am using is Eclipse.

The problem that I am having is that when an entity persists, one of its properties is of Date type, this is registered with a value one day before the one indicated.

Example:

You want to register 11-10-18 and register: 10-10-18.

    
asked by Michael Salinas Rios 04.11.2018 в 03:22
source

1 answer

0

It must be by default in a GTM schedule, you can add or configure the date you enter using this annotation:

  @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd@HH:mm:ss.SSSZ", locale = "en_GB") 

You can change the locale depends where you are.

    
answered by 04.11.2018 в 05:17