You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DateTimeFormatConfiguration.java 720B

1234567891011121314151617181920
  1. package vn.azteam.tpf.config;
  2. import org.springframework.context.annotation.Configuration;
  3. import org.springframework.format.FormatterRegistry;
  4. import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
  5. import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
  6. /**
  7. * Configure the converters to use the ISO format for dates by default.
  8. */
  9. @Configuration
  10. public class DateTimeFormatConfiguration implements WebMvcConfigurer {
  11. @Override
  12. public void addFormatters(FormatterRegistry registry) {
  13. DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
  14. registrar.setUseIsoFormat(true);
  15. registrar.registerFormatters(registry);
  16. }
  17. }