LocalDateTime转换为时间戳(秒),不要用ZoneOffset.of("+8"),如果你的系统默认时区不是+8就错了
localDateTime.atZone(ZoneId.systemDefault()).toEpochSecond()
可以看看这篇文章对新的日期api理解下: java中ZonedDateTime,LocalDateTime,Date,Calendar,Instant,timestamp的比较区别
LocalDateTime转换为时间戳(秒),不要用ZoneOffset.of("+8"),如果你的系统默认时区不是+8就错了
localDateTime.atZone(ZoneId.systemDefault()).toEpochSecond()
可以看看这篇文章对新的日期api理解下: java中ZonedDateTime,LocalDateTime,Date,Calendar,Instant,timestamp的比较区别