[Solved] This is showing 1-24 hours i need to 1-12 hours show how i can do this? [closed]

[ad_1]

getHours() actually returns 0-23…here is how to convert that into 1-12:

var hr = time.getHours();

if (hr > 12) {
    hr -= 12;
} else if (hr=== 0) {
   hr = 12;
}

0

[ad_2]

solved This is showing 1-24 hours i need to 1-12 hours show how i can do this? [closed]