标签:time orm return value turn print pos .post eth
spring mvc 默认用的是 jackson 来解析 json 的,所以 Date 的解析得下面这么用
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date lastupdatetime;
如果是@RequestParam则用这种方式:
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/testdate")
public String testdate(@RequestParam @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")Date birthday) {
System.out.println("a====a");
System.out.println(birthday);
return "aaa";
}
标签:time orm return value turn print pos .post eth
原文地址:http://www.cnblogs.com/20000ding/p/6820527.html