【发布时间】:2015-11-17 09:44:51
【问题描述】:
我的 JHipster 应用程序中有以下代码。当我在笔记本电脑上本地运行时,它会为我提供正确的时区。
@RequestMapping(value = "/points-this-week",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public ResponseEntity<PointsPerWeek> getPointsThisWeek(TimeZone timeZone) {
DateTimeZone usersTimeZone = DateTimeZone.forID(timeZone.getID());
log.debug("Getting points for week with timezone: {}", usersTimeZone);
// Get current date
LocalDate now = new LocalDate(usersTimeZone);
但是,在 Heroku 上运行时,timeZone.getID() 是“Etc/UTC”。是否可以在 JHipster 应用程序中获取客户的时区?
【问题讨论】:
标签: java spring-mvc heroku jodatime jhipster