json date format

{
  "serviceid":"1",
  "companyid":"1",
  "sid":"vxe0xuF9V9XK6UnKIW6GcuSmU0KgwJNnp7LCJ8sdiZPET7QD5x1hBdX01bT4p7rS",
  "username":"abc",
  "conferenceid":"1",
  "timestamp":"2020-08-06T22:07:07.263+09:00"
}

 

java filed 

@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS", timezone = "GMT+9")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS")
private Date timestamp;

 

JsonFormat必须指定时区,否则会出现时区有差别。

而不能如下,虽然不会出错,但是转出的时区会出问题。

@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS")
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS")
private Date timestamp;

ali key

key=AKIAJPDAXETRTZTEVSRA
key=9OxMOx2oBdCQ3h1Wy1oy5Ce+rTuUysYSY4JwcSAy

 

posted @ 2020-08-26 11:33  dunkbird  阅读(352)  评论(0编辑  收藏  举报