简体   繁体   中英

HOUR_OF_DAY in date showing 12 hr time

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM