Discuss / Java / 到达后的北京时间转化为纽约当地时间

到达后的北京时间转化为纽约当地时间

Topic source
static LocalDateTime calculateArrivalAtNY(LocalDateTime bj, int h, int m) {
    return bj.plusHours(h).plusMinutes(m).atZone(ZoneId.of("Asia/Shanghai")).withZoneSameInstant(ZoneId.of("America/New_York")).toLocalDateTime();
}

  • 1

Reply