The problem statement
Write a program that calculates how many whole hours are between the two date-time pairs of the same year.
Input data format
Two lines containing a date-time in a year-month-dayThour:minute format (without seconds and nanoseconds).
Output data format
The line containing an integer non-negative number.
Computer scienceProgramming languagesJavaAdditional instrumentsEssential standard classesDate and time
LocalDateTime
Whole hours between two date-time pairs
Report a typo
Sample Input 1:
2017-06-15T01:50
2017-06-16T01:10Sample Output 1:
23Sample Input 2:
2017-06-15T01:50
2017-06-15T02:50Sample Output 2:
1Write a program in Java 17
class Main {
public static void main(String[] args) {
// put your code here
}
}
___
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.