A booking form might receive a date, wall-clock time and region. That is not always enough to identify an instant. When clocks move forward, some local times do not exist. When they move backward, the same local time can identify two different appointments. A strict booking boundary can reject a gap and ask the user to choose an occurrence in an overlap.

Prerequisites

Use JDK 21 and save this as Booking.java. The example uses a fixed 2025 fixture in New York. It checks valid offsets before translating local fields to an instant. This avoids letting a convenience conversion silently choose an occurrence or move a time during a gap.

import java.time.*;
import java.util.List;

class Booking {
    static Instant resolve(String input, ZoneId zone, ZoneOffset chosen) {
        var local = LocalDateTime.parse(input);
        List<ZoneOffset> options = zone.getRules().getValidOffsets(local);
        if (options.isEmpty()) throw new IllegalArgumentException("gap");
        if (chosen == null && options.size() == 1) chosen = options.getFirst();
        if (chosen == null || !options.contains(chosen)) {
            throw new IllegalArgumentException("choose one of " + options);
        }
        return local.toInstant(chosen);
    }

    static void rejects(Runnable action, String expected) {
        try {
            action.run();
        } catch (IllegalArgumentException e) {
            if (e.getMessage().startsWith(expected)) return;
            throw e;
        }
        throw new AssertionError("unexpected success");
    }

    public static void main(String[] args) {
        var zone = ZoneId.of("America/New_York");
        var overlap = "2025-11-02T01:30";
        rejects(() -> resolve("2025-03-09T02:30", zone, null), "gap");
        rejects(() -> resolve(overlap, zone, null), "choose");
        rejects(() -> resolve(overlap, zone, ZoneOffset.UTC), "choose");
        assert resolve("2025-07-01T12:00", zone, null)
            .equals(Instant.parse("2025-07-01T16:00:00Z"));
        for (String offset : List.of("-04:00", "-05:00")) {
            System.out.println(resolve(overlap, zone, ZoneOffset.of(offset)));
        }
    }
}

Compile with javac Booking.java and run java -ea Booking. The -ea option enables the ordinary-time assertion. Expected output:

2025-11-02T05:30:00Z
2025-11-02T06:30:00Z

Keep the time and its interpretation separate

For an ordinary time there is one offset and the example can safely choose it. An overlap has multiple candidates, so passing no choice is an input error under this policy. The explicit null check matters even before validating membership because not all Java lists accept null as a lookup argument. A caller-supplied offset is checked even in the ordinary case. Without that check a typo can yield a valid instant that never corresponded to the requested local time in that region.

Use the resolved instant to identify a confirmed occurrence, and keep the zone and local fields when you need to show the original booking intent. Recurring jobs are a different problem. Resolve each intended local occurrence by policy instead of adding 24 hours to the previous instant. For future bookings, keep runtime zone data updated and decide whether rule changes should cause already-confirmed bookings to be reconsidered.

If parsing fails, check that you supplied an ISO local date-time without a trailing offset. The region and optional offset are independent inputs. If a user reports that two displayed options look identical, show the UTC offset or corresponding instant so the choice has meaning. If an appointment falls in a gap, ask for another wall time instead of assuming every transition jumps exactly an hour.

Reference: Java SE 21 ZoneRules. More Java tutorials.