Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using 24 hour time in bootstrap timepicker

Tags:

Hi im using http://eonasdan.github.io/bootstrap-datetimepicker/ 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.

Thanks.

like image 410
user2989367 Avatar asked Jan 09 '14 12:01

user2989367


People also ask

How can use Datepicker in bootstrap?

As with bootstrap's own plugins, datepicker provides a data-api that can be used to instantiate datepickers without the need for custom javascript. For most datepickers, simply set data-provide="datepicker" on the element you want to initialize, and it will be intialized lazily, in true bootstrap fashion.

Does bootstrap 4 have a Datepicker?

Bootstrap date picker is a plugin that adds the function of selecting time without the necessity of using custom JavaScript code. This documentation may contain syntax introduced in the MDB 4.17. 0 and can be incompatible with previous versions. For old Date Picker documentation please follow the link.


1 Answers

Use capitals letter for hours HH = 24 hour format an hh = 12 hour format

$('#fecha').datetimepicker({     format : 'DD/MM/YYYY HH:mm'  });
like image 83
Vladimir Salguero Avatar answered Sep 27 '22 22:09

Vladimir Salguero