Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TimePicker with 24 hour format

I using timepicker in my project but I need this time in 24 hour without am,pm this is my code

<div class="bootstrap-timepicker" >
<label for="email" class="col-sm-2 control-label">From Time</label>
<input type="text" id="from_time" class="form-control timepicker" style="width: 30%;" >
<label for="email" class="col-sm-2 control-label">To Time</label>
<input type="text" id="to_time" class="form-control timepicker" style="width: 30%;" >
<!-- /.input group -->
</div>

but this code give me 12 hour format like this

04:00 PM  

but what I want

16:00
like image 766
Maj.jad Avatar asked Nov 25 '25 00:11

Maj.jad


1 Answers

if you are using jquery timepicker

$('input.timepicker').timepicker({ timeFormat: 'HH:mm:ss', });

if you are using bootstrap timepicker

$(function () {
    $('#datetimepicker4').datetimepicker({
        pickDate: false,
        minuteStepping:30,
        format: 'hh:mm',
        pickTime: true,
        defaultDate: new Date(1979, 0, 1, 8, 0, 0, 0),
        language:'en',
        use24hours: true
    });
});
like image 65
Sanjit Bhardwaj Avatar answered Nov 27 '25 14:11

Sanjit Bhardwaj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!