To get Total Hours & Minutes when you have total time duration in minutes, All you need to do is:
Divide(/) Time Minutes by 60 to get Hours & then Math.floor() to remove the decimal places & to get minutes perform modules (%) on Minutes as shown below:
JavaScript get hours from minutes
const min = 129; const toHours = Math.floor(min/60); const toMinutes = min%60; // Will give reminder that is equal to minutes console.log(toHours," Hours ,",toMinutes," Minutes"); // 2 Hours , 9 Minutes
Convert minutes to hours in java
int minutes = 120; int hours = minutes / 60; int remainingMinutes = minutes % 60; System.out.println(hours + " hours and " + remainingMinutes + " minutes");
Convert minutes to hours in python
minutes = 130 hours = minutes // 60 remaining_minutes = minutes % 60 print(f"{hours} hours and {remaining_minutes} minutes")
Convert minutes to hours in dart
In dart to perform division we use ~/.
int minutes = 140; int hours = minutes ~/ 60; int remainingMinutes = minutes % 60; print("$hours hours and $remainingMinutes minutes");