candplus
candplus
发布于 2个月前

Java8 LocalDateTime

private static final DateTimeFormatter format = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
private static final ZoneId zone = ZoneId.systemDefault();
LocalDateTime datetime = LocalDateTime.parse("19-04-2019 00:00", format);
LocalDateTime lastdate = LocalDateTime.ofInstant(new Date().toInstant(), zone);

相关文章