Implement the subtractFromEpoch() method to subtract the given days from the EPOCH and print the result in the given time zone.
Computer scienceProgramming languagesJavaAdditional instrumentsEssential standard classesDate and time
Instant
Print the correct Instant unit
Report a typo
Sample Input 1:
10
Asia/YerevanSample Output 1:
1969-12-22T04:00+04:00[Asia/Yerevan]Write a program in Java 17
import java.util.Scanner;
import java.time.*;
import java.time.temporal.ChronoUnit;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
subtractFromEpoch(scanner.nextInt(), scanner.next());
}
public static void subtractFromEpoch(int days, String zone) {
}
}
___
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.