1

so am trying to subtract 30 minute to the variable of date the code works but I came across a issue where moment.js dosen't just covert the date to isoString but also reduce the time by an hour is there anywhere I can convert the string to the normal format without adding the hour manually

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.25.1/moment.min.js"></script>

  const date = '2021-04-26T12:00:00';
  allTime.map((time) => {
  console.log(time);
  const newTime = moment(time);
  const newAddTime = newTime.subtract(15, 'minutes');
  minutes.push(newAddTime.toISOString());
  // map another 15 minute back ward to a time to newTime
   const newAddTime2 = newTime.subtract(15, 'minutes');
   minutes.push(newAddTime2.toISOString());
 });

any help

nobody
  • 55
  • 6

0 Answers0