代码
static LocalDateTime calculateArrivalAtNY(LocalDateTime bj, int h, int m) { ZonedDateTime zbj = bj.atZone(ZoneId.of("Asia/Shanghai")); ZonedDateTime zdt = zbj.plusHours(h).plusMinutes(m); ZonedDateTime zny = zdt.withZoneSameInstant(ZoneId.of("America/New_York")); bj = zny.toLocalDateTime(); return bj; }
Sign in to make a reply
D
代码