mangala
mangala

Reputation: 143

Need to show 24 hrs to 12 hrs in timepicker jquery

I have used the $('#start_time').timepicker({ timeFormat: 'hh:mm:ss tt' }); .

But it still showing the 24 hours format.

I need to show the 12 hours format in timepicker with AM and PM.

Thanks in advance.

Upvotes: 2

Views: 19847

Answers (2)

MegaBytes
MegaBytes

Reputation: 6385

Its depends on which jquery plugin you are using. @mangala, suggest also right. I want to add litle more, as I use jquery.datetimepicker.js
Sample code is:

$("#start_time").datetimepicker({
    datepicker:false,
    format:'g:i A',
    formatTime: 'g:i A',
    mask:'29:59 99',
    step:5,
    ampm: true
});

It will helps you. This will give output as
enter image description here

Upvotes: 4

mangala
mangala

Reputation: 143

Thanks friends i found issue.

That code should be like

$('#start_time').timepicker({ timeFormat: 'hh:mm:ss tt', showSecond:true, ampm: true });

Upvotes: 6

Related Questions