- 1

I'm having trouble with the time converter in java. Can anybody give me any assistance?

This is a bonus problem in Java. https://code.sololearn.com/c09hQI3pie50/?ref=app

11th Oct 2021, 12:25 AM
Kevin Merric
Kevin Merric - avatar
7 Answers
+ 2
Firstly, what does it has to do with the code you posted ? & secondly you must show your attempt before asking for help.
11th Oct 2021, 12:42 AM
zexu knub
zexu knub - avatar
+ 1
Kevin Merric C'mon you have literally pasted the whole problem instead of what you tried, Anywho days * 24 * 60 * 60 Days * 24 = hours in each (N) Days Days * 24 * 60 = min in each (N) Days Days * 24 * 60 * 60 = sec in each (N) Days
11th Oct 2021, 1:37 AM
zexu knub
zexu knub - avatar
+ 1
11th Oct 2021, 1:40 AM
zexu knub
zexu knub - avatar
0
Just ask yourself. How many hours has a day. How many minutes has a hour. And so on. And if you want to know the current time as timestamp take a look at this. https://www.sololearn.com/learn/530/?ref=app
11th Oct 2021, 1:10 AM
Stefanoo
Stefanoo - avatar
0
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scanner.nextInt(); //your code goes here } } /*Explanation: 12 days are 12*24 = 288 hours, which are 288*60 = 17280 minutes, which are 17280*60 = 1036800 seconds.*\
11th Oct 2021, 1:25 AM
Kevin Merric
Kevin Merric - avatar
0
This is the problem. I've made many attempts before asking. Could somebody please help me solve this???
11th Oct 2021, 1:26 AM
Kevin Merric
Kevin Merric - avatar
0
I swear I've been trying for two days and kept having to reset it... I'll give it a try now ty
11th Oct 2021, 1:38 AM
Kevin Merric
Kevin Merric - avatar