title: convert 24 hours into 12 hours
body: <p>i have ionic code that load times for me but it make it 24 hours and i want it in 12 hours with AM or PM </p>
  
  <p>i tried many things but not work </p>
  
  <p>this is my code </p>
  
  <pre><code>loadTimes() {
      this.availabilityTimes = new Array&lt;Array&lt;string&gt;&gt;();
      for(let i = 0; i &lt; 7; i++){
          this.availabilityTimes.push(new Array&lt;string&gt;());
      }
      let date = new Date();
      for (let avail of this.availabilities) {
          let dateStart = new Date(date.getFullYear(), date.getMonth(), date.getDate(), Number(avail.start.split(':')[0]), Number(avail.start.split(':')[1]), 0);
          let dateEnd = new Date(date.getFullYear(), date.getMonth(), date.getDate(), Number(avail.end.split(':')[0]), Number(avail.end.split(':')[1]), 0);
  
          let availabilityTime = new Array&lt;string&gt;();
          let time: number = dateStart.getTime();
          while(time &lt;= dateEnd.getTime()) {
              let dateIn = new Date(time);
              availabilityTime.push((dateIn.getHours()&lt;10?('0'+dateIn.getHours()):String(dateIn.getHours())) +':'+ (dateIn.getMinutes()&lt;10?('0'+dateIn.getMinutes()):String(dateIn.getMinutes())) +':00');
              time = time + 3600000;
          }
  </code></pre>