JSFiddle - React, Tailwind, and code Playground
HTML
Current DateTime:<br/> <span id="currDateTime"></span><br/><br/>
Minus DateTime(-5 min):<br/> <span id="minusDateTime"></span><br/><br/>
Add DateTime(+5 min):<br/> <span id="addDateTime"></span><br/><br/>
JavaScript
var currDateTime = new Date(),
hr = currDateTime.getHours(),
min = currDateTime.getMinutes(),
dd = currDateTime.getDate(),
mm = currDateTime.getMonth() + 1,
yyyy = currDateTime.getFullYear();
//adding pad while getting singles in date or month between 0-9
if(dd < 10){ dd = '0' + dd} if(mm < 10){ mm = '0' + mm}
//current date and time as per UTC format
currDateTime = yyyy +'/'+ mm +'/'+ dd +" "+ hr + ':' + min + ":00";
$("#currDateTime").text(new Date(currDateTime).toUTCString());
//minus -5 minutes to actual date and time
currDateTime = yyyy +'/'+ mm +'/'+ dd + " "+ hr + ':' + (min - 5) + ":00";
$("#minusDateTime").text(new Date(currDateTime).toUTCString());
//we are now going to add +5 min to currDateTime
currDateTime = yyyy +'/'+ mm +'/'+ dd + " "+ hr + ':' + (min + 5) + ":00";
$("#addDateTime").text(new Date(currDateTime).toUTCString());