- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Program to get the number of minutes in this duration
At first, set the Duration:
Duration duration = Duration.ofHours(10);
Now, get the number of minutes from the above Duration that has 10 hours:
d1.toMinutes()
Example
import java.time.Duration; public class Demo { public static void main(String[] args) { Duration d1 = Duration.ofDays(25); Duration d2 = Duration.ofHours(10); System.out.println("Minutes in 25 days = "+d1.toMinutes()); System.out.println("Minutes in 10 hours = "+d2.toMinutes()); } }
Output
Minutes in 25 days = 36000 Minutes in 10 hours = 600
Advertisements
To Continue Learning Please Login
Login with Google