-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, please how can convert minute to second?
Hum not really ZK related. There is 60 seconds in a minute, so to convert minutes to seconds, you just need to multiply your minute number by 60 ?
EDIT: You say it doesnt work in Java, I'm guessing you have type issue. Can you post your code?
To get rid of all those ugly 1000 * 60 * 60 * 24 ... and the like:
you can use the jdk built-in TimeUnit class to convert between arbitrary time units:
long seconds = java.util.concurrent.TimeUnit.MINUTES.toSeconds(5);
//seconds -> 300
just in case you're not aware of that
Asked: 2015-06-17 20:13:03 +0800
Seen: 17 times
Last updated: Jun 18 '15
multiply by 60?
chillworld ( 2015-06-17 20:49:15 +0800 )editit doesn't work in java
Fzacraoui ( 2015-06-17 21:17:03 +0800 )editi use this int depM = (int) (depassement%60); int depH = (int) (depassement/60); // to convert minut to hours and it gives me something like that hh:mm , now i need to do something like that to convert minute to second ?
Fzacraoui ( 2015-06-18 11:46:29 +0800 )editdepassement is your total minutes right? So if you want to have total seconds it's depassement * 60. If you need hh:mm:ss => your seconds will always be 0 because you started with minutes.
chillworld ( 2015-06-18 14:01:56 +0800 )editExactely i'm calculating by minutes dep is in minutes, i need to show it like that hh:mm:ss , i try to multiple by 60. but dosn't work :(
Fzacraoui ( 2015-06-18 15:29:18 +0800 )edit