【发布时间】:2017-08-31 19:56:41
【问题描述】:
假设我的 RestController 中有
@GetMapping("/")
public list(@RequestParam LocalDateTime date) {
}
我使用日期请求参数作为 unix 时间戳发出 GET 请求,如下所示:
http://myserver.com/?date=1504036215944
如何让 Spring Boot 和 jackson 自动使用从 unix 时间戳到 LocalDateTime 的正确转换,而无需手动进行转换。
【问题讨论】:
-
@maytham-ɯɐɥʇʎɐɯ 它不是重复的,它与 SpringBoot 而不是 Spring 相关
-
@danial 问题解决了吗?
标签: java spring spring-boot unix-timestamp