user2989367 user2989367 - 1 year ago 348
Javascript Question

Using 24 hour time in bootstrap timepicker

Hi im using on bootstrap, specifically example number 4.

I added this property to take away the PM thing and be able to use 24 system on the widget itself:

format: 'hh:mm',

But lets say I pick 16:00 on the widget it shows up at 04:00 on the input itself as opposed to 16:00.

I could not find anything in the documentation about this so if anyone knows a fix for this it would be really appreciated.


Answer Source

EDIT: There are much better answers on this thread than this one. I was just getting the hang of JavaScript at the time I answered. Specifically, see these two.

If you search within the development version of that script, there's a function called use24hours that looks for a value of either true or false.

Adding use24hours:true might do the job for you. Like so:

$(function () {
        use24hours: true
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download