Discuss / Java / 交作业

交作业

Topic source

墨染尘霞

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

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

        bj=bj.plusHours(h).plusMinutes(m).atZone(ZoneId.of("Asia/Shanghai")).withZoneSameInstant(ZoneId.of("America/New_York")).toLocalDateTime();

        //调整时间->toZoned->同一时刻下时区转换->toLocalDateTime

        return bj;

    }


  • 1

Reply