Search code examples
jquerytimepicker

Jquery ->Timepicker : How do i add zero value in every single digit hour in timepicker


i have a timepicker like this :

$('#datepickerTime').timepicker({
    timeFormat : "hh:mm:ss"
});

but when time is 1 to 9 it will not add zero to the front(eg. 01:30), How do i add zero in from of every single digit hours? thanks


Solution

  • You shlould initialize timepicker with this ::

    $('#datepickerTime').timepicker({ 'timeFormat': 'H:i:s' });
    

    this will generate the output showing in image::

    enter image description here

    UPDATED As per comment::

    HTML

    <input type="text" name="datepickerTime" id="datepickerTime" />