spring boot中全局设置时间格式

在yml或者properties文件中设置,这里用的是yml

spring:
  jackson:
    date-format: yyyy-MM-dd #如果使用字符串表示,用这行设置格式
    timezone: GMT+8
    serialization:
      write-dates-as-timestamps: false #使用时间戳,使用数值timestamp表示日期

若最后一行设置了true,则会以时间戳为标准。

猜你喜欢

转载自blog.csdn.net/m0_38044453/article/details/82180480