How to add 30 minutes to a JavaScript Date object?

JavascriptWeb DevelopmentFront End Technology

To add minutes to a JavaScript Date object, use the setMinutes() method. Under that, get the current minutes and 30 minutes to it. JavaScript date setMinutes() method sets the minutes for a specified date according to local time.


You can try to run the following code to add 30 minutes to date.

 Live Demo

      <title>JavaScript setMinutes Method</title>
         var dt = new Date();
         dt.setMinutes( dt.getMinutes() + 30 );
         document.write( dt );


Sat Dec 15 2018 12:18:47 GMT+0530 (India Standard Time)
Published on 13-Feb-2018 08:32:26