| | |
| | | @PostConstruct |
| | | void init() { |
| | | // 强制设置默认时区(影响整个JVM) |
| | | TimeZone.setDefault(TimeZone.getTimeZone("Europe/Paris")); |
| | | System.setProperty("user.timezone", "Europe/Paris"); |
| | | TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai")); |
| | | System.setProperty("user.timezone", "Asia/Shanghai"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | port: 8235 |
| | | spring: |
| | | datasource: |
| | | # url: jdbc:mysql://127.0.0.1:6306/8.4?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&serverTimezone=Europe/Paris&useLegacyDatetimeCode=false |
| | | url: jdbc:mysql://127.0.0.1:3306/trading_order?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&serverTimezone=Europe/Paris&useLegacyDatetimeCode=false |
| | | # url: jdbc:mysql://127.0.0.1:6306/8.4?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useLegacyDatetimeCode=false |
| | | url: jdbc:mysql://127.0.0.1:3306/trading_order?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useLegacyDatetimeCode=false |
| | | username: root |
| | | password: eca8e8e65acfaacf |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | properties: |
| | | hibernate: |
| | | jdbc: |
| | | time_zone: Europe/Paris |
| | | time_zone: Asia/Shanghai |
| | | jackson: |
| | | time-zone: Europe/Paris |
| | | time-zone: Asia/Shanghai |
| | | cache: |
| | | type: redis |
| | | redis: |
| | |
| | | enabled: true |
| | | jackson: |
| | | date-format: yyyy-MM-dd HH:mm:ss |
| | | time-zone: Europe/Paris |
| | | time-zone: Asia/Shanghai |
| | | mvc: |
| | | pathmatch: |
| | | matching-strategy: ANT_PATH_MATCHER |
| | |
| | | properties: |
| | | hibernate: |
| | | jdbc: |
| | | time_zone: Europe/Paris |
| | | time_zone: Asia/Shanghai |
| | | # mybaits-plus配置 |
| | | mybatis-plus: |
| | | # MyBatis Mapper所对应的XML文件位置 |
| | |
| | | private String whitepaperUrl; |
| | | |
| | | @ApiModelProperty("申购开始时间") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date startDate; |
| | | |
| | | @ApiModelProperty("申购结束时间") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date endDate; |
| | | |
| | | @ApiModelProperty("上市开始时间") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date marketDate; |
| | | |
| | | @ApiModelProperty("货币图片地址") |
| | |
| | | |
| | | |
| | | @ApiModelProperty("中签时间") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai") |
| | | private Date endTime; |
| | | |
| | | @ApiModelProperty("备注") |
| | |
| | | /** |
| | | * 创建日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Europe/Paris") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | /** |
| | |
| | | /** |
| | | * 更新日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Europe/Paris") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | |
| | |
| | | |
| | | public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; |
| | | |
| | | public static final String DEFAULT_TIME_ZONE = "Europe/Paris"; |
| | | public static final String DEFAULT_TIME_ZONE = "Asia/Shanghai"; |
| | | |
| | | public static final String NORMAL_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; |
| | | |
| | |
| | | if (format == null || format.isEmpty()) { |
| | | format = "yyyy-MM-dd HH:mm:ss"; |
| | | } |
| | | TimeZone timeZone = TimeZone.getTimeZone("GMT+8"); |
| | | TimeZone timeZone = TimeZone.getTimeZone("Asia/Shanghai"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat(format); |
| | | sdf.setTimeZone(timeZone); |
| | | // 类库使用时候,也保证有个正确结果 |
| | |
| | | if (millisecond == null || millisecond.isEmpty() || millisecond.equals("null")) { |
| | | return ""; |
| | | } |
| | | TimeZone timeZone = TimeZone.getTimeZone("GMT+8"); |
| | | TimeZone timeZone = TimeZone.getTimeZone("Asia/Shanghai"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | sdf.setTimeZone(timeZone); |
| | | return sdf.format(new Date(Long.valueOf(millisecond))); |