import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;

public class Main {
    public static void main(String[] args) {
        Duration result = calculateTimeDifference("-2", "2023-07-16");
        System.out.println("Time Difference Calculated : " + result);
        // You can get time units separately as well
        System.out.printf("%d hours, %d minutes%n", result.toHoursPart(), result.toMinutesPart());
    }

    static Duration calculateTimeDifference(String hotelOffset, String CheckInDt) {
        LocalDateTime nowInNY = LocalDateTime.now(ZoneId.of("America/New_York"));

        // Convert hotel's timezone offset string to minutes
        int offsetValue = Integer.parseInt(hotelOffset);
        int offsetInMinutes = offsetValue * 30;

        LocalDateTime nowAtHotel = nowInNY.plusMinutes(offsetInMinutes);

        LocalDateTime checkInDateTime = LocalDate.parse(CheckInDt)
                                            .atTime(LocalTime.of(15, 0));

        return Duration.between(nowAtHotel, checkInDateTime);
    }
}