I am using intellij for a javaee project and I get problems with time storage : there is a shift of 2 hours between what I put and the hour really stored in mysql.
some searches on internet gave nothing at the moment.
here is the java statement in which I set the hour of 15:30
Bien bien = new Bien(0, "mon super bien #2", 320, 5, 3, true,
520000, "4 impasse des bleuets",
LocalDateTime.of(2019, Month.MAY,1,15,30),
false, bien0.getTypeChauffage(), bien0.getOptions(), bien0.getVille());
and you can see on the picture at the right that the stored hour is 13:30!! 2 hours were lost.
some informations :
I live in France, which is UTC+2 on summer hour; so I put this line in mysql' my.ini:
default-time-zone='+02:00'
and in phpmyadmin, if I type
select now();
I get the correct hour.
The wrong time is got from both intellij and phpmyadmin. The wrong time was got even before changing the default-time-zone in mysql.(but when I changed the timezone the previously entered datetime were shifted). the conection string is very usual,without any extra parameter(only database, port,user,password).
I will continue to search, but if someone can help me it would be kind.