Implement the printZoneRules() method to find the offset of the region by the given date and time.
Computer scienceProgramming languagesJavaAdditional instrumentsEssential standard classesDate and time
ZonedDateTime and OffsetDateTime
Find the required offset
Report a typo
Sample Input 1:
Asia/YerevanSample Output 1:
+04:00Write a program in Java 17
import java.util.Scanner;
import java.time.*;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
LocalDateTime localDateTime = LocalDateTime.of(1991, 4, 15, 15, 0);
ZoneId zoneId = ZoneId.of(scanner.nextLine());
printZoneRules(zoneId, localDateTime);
}
public static void printZoneRules(ZoneId zoneId, LocalDateTime localDateTime) {
}
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.