I'm using the bootstrap ready date time picker from http://eonasdan.github.io/bootstrap-datetimepicker/ and it's working nicely but for one issue. I have a picker setup just from time as so:
$(function () { $('#startTime, #endTime').datetimepicker({ format: 'hh:mm', pickDate: false, pickSeconds: false, pick12HourFormat: false }); });
This sets the picker to 24 hour so I can select 19:00 as a time. But when I choose this time it displays as 07:00 in the input box. Here is the setup displaying the picker:
<div class="input-group date timePicker" id="endTime"> <input type='text' class="form-control" readonly="true" id="endTimeContent" /> <span class="input-group-addon"><span class="glyphicon glyphicon-time"></span> </span> </div>
Is there a specific data-format I can use for 24 hour in the input box?
TimePicker is a view for selecting the time of day, in either 24 hour or AM/PM mode. You can use setIs24HourView(true) method with TimePicker.
In the Data type box, click Date and Time (dateTime). Click Format. In the Date and Time Format dialog box, in the Display the time like this list, click the option that you want, and then click OK. In the Date Picker Properties dialog box, under Default Value, click Insert Formula .
Android Date Picker allows you to select the date consisting of day, month and year in your custom user interface. For this functionality android provides DatePicker and DatePickerDialog components. In this tutorial, we are going to demonstrate the use of Date Picker through DatePickerDialog.
Because the picker script is using moment.js to parse the format string, you can read the docs there for proper format strings.
But for 24Hr time, use HH
instead of hh
in the format.
$(function () { $('#startTime, #endTime').datetimepicker({ format: 'HH:mm', pickDate: false, pickSeconds: false, pick12HourFormat: false }); });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With