In spring boot, when timestamp is output, it will be automatically formatted as a string, how to set not to format automatically

spring boot automatically formats attributes of time type as string (String), when controller outputs an object as @ ResponseBody. I don"t want to do this. I want to calculate time at the front end, so I want spring to output the properties of time type directly to a timestamp (int type), and then handle it itself at the front end.

I don"t know how to set up spring-boot.

Mar.18,2021

if you add ResponseBody, it must be encapsulated into a json string, but there is a doubt that the timestamp of the string obtained at the front end can be parsed into human able time

.
Menu