时间戳:
时间戳是从1970年1月1日(UTC/GMT的午夜)开始所经过的秒数,不考虑闰秒。
问题代码:
结果示意图:
解决方式:
代码:
@RequestMapping("/json2") @ResponseBody @CrossOrigin public String json() throws JsonProcessingException { ObjectMapper objectMapper = new ObjectMapper(); //关闭时间戳功能 objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS,false); //时间格式化问题,自定义日期格式对象 SimpleDateFormat sdf = new SimpleDateFor