Discuss / Java / 大同小异

大同小异

Topic source

何霖

#1 Created at ... [Delete] [Delete and Lock User]

static LocalDateTime calculateArrivalAtNY(LocalDateTime bj, int h, int m) {

      ZonedDateTime zbj = bj.atZone(ZoneId.of("Asia/Shanghai"));

      ZonedDateTime zbjNew = zbj.plusHours(13).plusMinutes(20);

      ZonedDateTime zny = zbjNew.withZoneSameInstant(ZoneId.of("America/New_York"));

      return zny.toLocalDateTime();

}


  • 1

Reply