Solve springboot + maven + swagger back in time to return to the foreground deviation problems

Solve springboot + maven + swagger back in time to return to the foreground deviation problems

Can be solved in two ways
1. added to the entity class attribute type Date annotation

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")

Mainly timezone = "GMT + 8" regulate action time error; Date disadvantage is that each entity attribute of each item in the class must add annotations, the embodiment of FIG: it can also choose the second method.
Here Insert Picture Description
2. Add the configuration file in application.yml inside:

jackson:
  date-format: yyyy-MM-dd HH:mm:ss
  time-zone: GMT+8

Where the date-format write from time to write, to see to their needs, oh I did not use, for example, the figure below:
Here Insert Picture Description

Released nine original articles · won praise 4 · Views 3140

Guess you like

Origin blog.csdn.net/weixin_43642706/article/details/103298130