get Arrival Time as ZonedDateTime - Java java.time

Java examples for java.time:ZonedDateTime

Description

get Arrival Time as ZonedDateTime

Demo Code


//package com.java2s;
import java.time.ZoneId;
import java.time.ZonedDateTime;

public class Main {
    public static ZonedDateTime getArrivalTime(ZonedDateTime zonedDateTime,
            ZoneId zoneId, int hour, int minute) {
        return zonedDateTime.plusHours(hour).plusMinutes(minute)
                .withZoneSameInstant(zoneId);
    }//ww  w  .j a  v a 2 s .co  m
}

Related Tutorials