문제

I am trying to display time in this format hh:mm in jsinner control

But I am getting 12 hrs time not 24 hrs

Here is my code

Where am I wrong

Date date = new Date();
SpinnerDateModel sm = new SpinnerDateModel(date, null, null, Calendar.HOUR_OF_DAY);
arr_time.setModel(sm);
JSpinner.DateEditor ar = new JSpinner.DateEditor(arr_time, "hh:mm");
arr_time.setEditor(ar);

Pls guide

도움이 되었습니까?

해결책

Try

JSpinner.DateEditor ar = new JSpinner.DateEditor(arr_time, "HH:mm");

hh indicates 12 hour format. HH indicates 24 hour format

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top