var hours = dt.getHours() minute = dt.getMinutes(); hours = (hours % 12) || 12; console.log("Time is - " + hours + ":" + minure;