I am trying to convert my time in minutes to HH: MM. For example, 418minutes = 6:58. I am using the following code:
long milli = PriemCas*60000;
Calendar calendar1 = Calendar.getInstance();
calendar1.setTimeInMillis(milli);
int hours3 = calendar1.get(Calendar.HOUR_OF_DAY);
int minutes3 = calendar1.get(Calendar.MINUTE);
System.out.println(hours3+":"+minutes3);
I get 7:58 when my variable PriemCas = 418 instead of 6:58. What could be wrong here? Many thanks.
source
share