Find the required offset

Report a typo

Implement the printZoneRules() method to find the offset of the region by the given date and time.

Sample Input 1:

Asia/Yerevan

Sample Output 1:

+04:00
Write 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) {

}
}
___

Create a free account to access the full topic