见:https://github.com/apache/incubator-streampark/pull/2583 该pr把jackson配置从代码更换到配置文件中,让使用的用户更改time-zone ToStringSerializer.instance); return module; } 然后是配置文件 spring: jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone
CreateConnectionThread.run(DruidDataSource.java:2785) Caused by: java.time.zone.ZoneRulesException: Unknown time-zone CreateConnectionThread.run(DruidDataSource.java:2785) Caused by: java.time.zone.ZoneRulesException: Unknown time-zone CreateConnectionThread.run(DruidDataSource.java:2785) Caused by: java.time.zone.ZoneRulesException: Unknown time-zone CreateConnectionThread.run(DruidDataSource.java:2785) Caused by: java.time.zone.ZoneRulesException: Unknown time-zone CreateConnectionThread.run(DruidDataSource.java:2785) Caused by: java.time.zone.ZoneRulesException: Unknown time-zone
jackson: default-property-inclusion: NON_NULL #date-format: yyyy-MM-dd HH:mm:ss time-zone
get": "action": "LED_ON", "meta": "Authorization": "token 8668c64f40d172be31eb4f12cbcaf4e57c9e1e3c", "Time-Zone ": \"LED_ON\",\ \"meta\": \"Authorization\": \"token 8668c64f40d172be31eb4f12cbcaf4e57c9e1e3c\",\ \"Time-Zone
private Date date; 2.在application.yml中添加配置 spring: jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone
解决方案 在 application.yml 添加配置: spring: jackson: time-zone: GMT+8
character-set-server参数无法生效,默认值为latin1 8版本不设置默认值为utf8mb4 [mysqld] character-set-server=utf8mb4 部分配置项不生效,例如port,time-zone
例如下例选择了数据库分区2: spring: application: name: demo-web jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone
minimum-idle: 10 pool-name: HikariPool jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone minimum-idle: 10 pool-name: GuliHikariPool jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone
978 A milli-of-day number 1234 n nano-of-second number 987654321 N nano-of-day number 1234000000 V time-zone ID zone-id America/Los_Angeles; Z; -08:30 z time-zone name zone-name Pacific Standard Time; PST O localized
write_numbers_as_strings: true #格式化返回时间 yyyy-MM-dd HH:mm:ss date-format: yyyy-MM-dd HH:mm:ss time-zone
我们可以在application.yml文件里面加入: spring: jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone
#配置时间的格式 jackson: default-property-inclusion: ALWAYS date-format: yyyy-MM-dd HH:mm:ss time-zone
spring.jackson.time-zone=GMT+8 application.yml spring: jackson: date-format: yyyy-MM-dd'T'HH:mm:ss.SSSZ time-zone
true&useSSL=false&allowPublicKeyRetrieval=true username: root password: 123456 jackson: time-zone true&useSSL=false&allowPublicKeyRetrieval=true username: root password: 123456 jackson: time-zone
System.out.println("Current Date in IST=" + todayKolkata); //java.time.zone.ZoneRulesException: Unknown time-zone System.out.println("Current Time in IST=" + timeKolkata); //java.time.zone.ZoneRulesException: Unknown time-zone System.out.println("Current Date in IST=" + todayKolkata); //java.time.zone.ZoneRulesException: Unknown time-zone
Tips: consider the case carefully. ask these questions: If your application will be used in different time-zone
Tips: consider the case carefully. ask these questions: If your application will be used in different time-zone
number 987654321 N nano-of-day number 1234000000 V time-zone ID zone-id America/Los_Angeles; Z; -08:30 z time-zone name
#指定日期格式,比如yyyy-MM-dd HH:mm:ss date-format: yyyy-MM-dd HH:mm:ss #指定日期格式化时区 time-zone