I want make to make hours
and minutes
arrays which for 19:49
should contain
hours[0] = 1
hours[1] = 9
minutes[0] = 4
minutes[1] = 9
Problem is that when I execute code:
Calendar rightNow = Calendar.getInstance();
String hour[] = String.valueOf(rightNow.get(Calendar.HOUR_OF_DAY)).split("");
String minute[] = String.valueOf(rightNow.get(Calendar.MINUTE)).split("");
and when I print this
System.out.println(hour[0] + ""+hour[1] + ":" + minute[0] +""+minute[1]);
I have this output 1:4
, but it should be 19:49
Update: I am using 1.7 JDK and form what I see hour[2]
contains 9
and minute[2]
9
.