title: How to get 24 hour time with moment js
body: <p>Is this the correct way to get all the times in the day? Is there a better way to do it? Also keep in mind that i will be using this time slots to compare if a time will be in between these slots. Thanks!</p>
  
  <pre><code>    const startAndEndTimes =[
          {startTime: apptDate.setHours(1, 0, 0), endTime: apptDate.setHours(2, 0, 0)},
          {startTime: apptDate.setHours(2, 0, 0), endTime: apptDate.setHours(3, 0, 0)},
          {startTime: apptDate.setHours(3, 0, 0), endTime: apptDate.setHours(4, 0, 0)},
          {startTime: apptDate.setHours(4, 0, 0), endTime: apptDate.setHours(5, 0, 0)},
          {startTime: apptDate.setHours(5, 0, 0), endTime: apptDate.setHours(6, 0, 0)},
          {startTime: apptDate.setHours(6, 0, 0), endTime: apptDate.setHours(7, 0, 0)},
          {startTime: apptDate.setHours(7, 0, 0), endTime: apptDate.setHours(8, 0, 0)},
          {startTime: apptDate.setHours(8, 0, 0), endTime: apptDate.setHours(9, 0, 0)},
          {startTime: apptDate.setHours(9, 0, 0), endTime: apptDate.setHours(10, 0, 0)},
          {startTime: apptDate.setHours(10, 0, 0), endTime: apptDate.setHours(11, 0, 0)},
          {startTime: apptDate.setHours(11, 0, 0), endTime: apptDate.setHours(12, 0, 0)},
          {startTime: apptDate.setHours(12, 0, 0), endTime: apptDate.setHours(13, 0, 0)},
          {startTime: apptDate.setHours(13, 0, 0), endTime: apptDate.setHours(14, 0, 0)},
          {startTime: apptDate.setHours(14, 0, 0), endTime: apptDate.setHours(15, 0, 0)},
          {startTime: apptDate.setHours(15, 0, 0), endTime: apptDate.setHours(16, 0, 0)},
          {startTime: apptDate.setHours(16, 0, 0), endTime: apptDate.setHours(17, 0, 0)},
          {startTime: apptDate.setHours(17, 0, 0), endTime: apptDate.setHours(18, 0, 0)},
          {startTime: apptDate.setHours(18, 0, 0), endTime: apptDate.setHours(19, 0, 0)},
          {startTime: apptDate.setHours(19, 0, 0), endTime: apptDate.setHours(20, 0, 0)},
          {startTime: apptDate.setHours(20, 0, 0), endTime: apptDate.setHours(21, 0, 0)},
          {startTime: apptDate.setHours(21, 0, 0), endTime: apptDate.setHours(22, 0, 0)},
          {startTime: apptDate.setHours(22, 0, 0), endTime: apptDate.setHours(23, 0, 0)},
          {startTime: apptDate.setHours(23, 0, 0), endTime: apptDate.setHours(24, 0, 0)},
      ]
  </code></pre>