Querria desarrollar mi app de Spring Boot App en Visual Studio Code ya que es uno de los mas potentes editores actualmente y la comodida de este super con creces eclipse.
AL ejecutarlo me arroja el siguiente error:
java.sql.SQLException: The server time zone value 'Hora de verano romance' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
Busque sobre el error y encontre que añadiendo esta funcion :
@PostConstruct
public void init(){
TimeZone.setDefault(TimeZone.getTimeZone("UTC")); // It will set UTC timezone
System.out.println("Spring boot application running in UTC timezone :"+new Date()); // It will print UTC timezone
}
Se deberia de arreglar, quedando asi mi clase main de Spring Boot App:
package com.tienda.tienda;
import java.util.Date;
import java.util.TimeZone;
import javax.annotation.PostConstruct;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan
public class DemoApplication {
@PostConstruct
public void init(){
TimeZone.setDefault(TimeZone.getTimeZone("UTC")); // It will set UTC timezone
System.out.println("Spring boot application running in UTC timezone :"+new Date()); // It will print UTC timezone
}
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}