DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
OffsetDateTime dateTime = OffsetDateTime.of(LocalDateTime.parse("2017-02-03 12:30:30", FORMATTER), OffsetDateTime.now().getOffset());
OffsetDateTime.now().getOffset():这个操作为了获取默认时区,可根据需求设置
网友评论