time - Java: calendar.setTimeInMillis() returns wrong HOUR_OF_DAY value -


i trying convert time in minutes hh:mm. example 418minutes = 6:58. using 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 7:58 when variable priemcas = 418 instead of 6:58. wrong here? thank much.

create calendar correct time zone:

calendar calendar1 = calendar.getinstance(timezone.gettimezone("utc")); 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -