add hour in date javascript code example
Example 1: javascript add minutes to date
//add 30 minutes to date
var minutesToAdd=30;
var currentDate = new Date();
var futureDate = new Date(currentDate.getTime() + minutesToAdd*60000);
Example 2: javascript get hour from date
var myDate = new Date(2019, 11, 24, 10, 33);
var hour = myDate.getHours();